Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: revamp provisioning ui to v3 and add ping fed scim docs

Scott Wilsonab80818c20d3
diff --git a/.env.example b/.env.example
index f14bc7608f..fd4fdc50c8 100644
--- a/.env.example
+++ b/.env.example
@@ -141,3 +141,12 @@ KUBERNETES_AUTO_FETCH_SERVICE_ACCOUNT_TOKEN=false
# ClickHouse (optional) for audit log storage
# CLICKHOUSE_URL=http://infisical:infisical@clickhouse:8123/infisical
+
+# PingFederate dev container (only needed for `make up-dev-pingfed`).
+# Register for free Ping DevOps credentials at https://devops.pingidentity.com/how-to/devopsRegistration/
+# Or leave both blank to run in Trial Product mode (uses bundled license, expires periodically).
+PING_IDENTITY_DEVOPS_USER=
+PING_IDENTITY_DEVOPS_KEY=
+
+# Local Active Directory dev container (only needed for `make up-dev-ad`).
+SAMBA_ADMIN_PASSWORD=Passw0rd!
diff --git a/Makefile b/Makefile
index 91d01531e5..63a6ba9b21 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,26 @@ reviewable: reviewable-ui reviewable-api
up-dev-sso:
docker compose -f docker-compose.dev.yml --profile sso up --build
+up-dev-pingfed:
+ docker compose -f docker-compose.dev.yml --profile pingfed up --build
+
+up-dev-ad:
+ docker compose -f docker-compose.dev.yml --profile ad up --build
+
+seed-dev-ad:
+ docker compose -f docker-compose.dev.yml exec samba-ad bash -c '\
+ samba-tool domain trust namespaces --add-upn-suffix=infisical.com 2>/dev/null || true; \
+ samba-tool user delete jdoe 2>/dev/null || true; \
+ samba-tool user delete asmith 2>/dev/null || true; \
+ samba-tool group delete infisical-users 2>/dev/null || true; \
+ samba-tool user create jdoe "Passw0rd!" --given-name=John --surname=Doe [email protected]; \
+ samba-tool user create asmith "Passw0rd!" --given-name=Alice --surname=Smith [email protected]; \
+ samba-tool user rename jdoe [email protected]; \
+ samba-tool user rename asmith [email protected]; \
+ samba-tool group add infisical-users; \
+ samba-tool group addmembers infisical-users jdoe,asmith \
+ '
+
# Golang commands
go-generate:
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 423490c8cb..d26f6d6d9b 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -113,11 +113,15 @@ services:
- NODE_ENV=development
- DB_CONNECTION_URI=postgres://infisical:infisical@db/infisical?sslmode=disable
- TELEMETRY_ENABLED=false
+ # Dev-only: lets the backend accept PingFederate's self-signed cert when testing
+ # OIDC locally via `make up-dev-pingfed`. NEVER set this in production.
+ # NODE_TLS_REJECT_UNAUTHORIZED=0
volumes:
- ./backend/src:/app/src
- softhsm_tokens:/etc/softhsm2/tokens # SoftHSM tokens are stored in a volume to persist across container restarts
extra_hosts:
- "host.docker.internal:host-gateway"
+ - "pf.local:host-gateway" # PingFederate dev container — resolves the same on host and inside compose
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/api/status"]
interval: 30s
@@ -261,6 +265,62 @@ services:
- 8088:8080
profiles: [sso]
+ pingfederate:
+ # Requires free Ping Identity DevOps credentials — register at
+ # https://devops.pingidentity.com/how-to/devopsRegistration/
+ # then set PING_IDENTITY_DEVOPS_USER and PING_IDENTITY_DEVOPS_KEY in your .env.
+ # Alternatively, leave both unset to run in Trial Product mode using the
+ # bundled license from pingidentity-server-profiles (expires periodically).
+ # Admin console: https://localhost:9999/pingfederate (administrator / 2FederateM0re)
+ # Runtime endpoint (SAML/OIDC/SCIM): https://localhost:9031
+ image: pingidentity/pingfederate:2604
+ restart: always
+ environment:
+ - PING_IDENTITY_ACCEPT_EULA=YES
+ - PING_IDENTITY_DEVOPS_USER=${PING_IDENTITY_DEVOPS_USER}
+ - PING_IDENTITY_DEVOPS_KEY=${PING_IDENTITY_DEVOPS_KEY}
+ - SERVER_PROFILE_URL=https://github.com/pingidentity/pingidentity-server-profiles.git
+ - SERVER_PROFILE_PATH=getting-started/pingfederate
+ # Enable Outbound Provisioning runtime for SCIM testing.
+ # Maps to pf.provisioner.mode in run.properties. STANDALONE = single node.
+ - PF_PROVISIONER_MODE=STANDALONE
+ ports:
+ - 9999:9999 # admin console
+ - 9031:9031 # runtime (SAML/OIDC/SCIM)
+ volumes:
+ - pingfederate_data:/opt/out
+ extra_hosts:
+ - "host.docker.internal:host-gateway"
+ profiles: [pingfed]
+
+ samba-ad:
+ # Samba 4 Active Directory Domain Controller for SCIM/SSO testing.
+ # Bootstraps an ACME.LOCAL domain on first start (~60s).
+ # Admin: Administrator / value of SAMBA_ADMIN_PASSWORD (defaults to Passw0rd!).
+ # Reachable from compose network at samba-ad:389; from host at localhost:1389.
+ image: nowsci/samba-domain:latest
+ container_name: infisical-dev-samba-ad
+ hostname: dc1
+ cap_add:
+ - SYS_ADMIN
+ privileged: true
+ environment:
+ - DOMAIN=ACME.LOCAL
+ - DOMAIN_DC=dc=acme,dc=local
+ - DOMAINPASS=${SAMBA_ADMIN_PASSWORD:-Passw0rd!}
+ - DNSFORWARDER=8.8.8.8
+ - HOSTIP=0.0.0.0
+ - INSECURELDAP=true # dev only — allows ldap:// without TLS
+ ports:
+ - 1389:389 # ldap (mapped off 389 to coexist with the openldap profile)
+ - 1636:636 # ldaps
+ - 88:88 # kerberos
+ - 88:88/udp
+ volumes:
+ - samba_data:/var/lib/samba
+ - samba_etc:/etc/samba/external
+ profiles: [ad]
+
volumes:
postgres-data:
driver: local
@@ -272,6 +332,9 @@ volumes:
driver: local
ldap_data:
ldap_config:
+ pingfederate_data:
+ samba_data:
+ samba_etc:
grafana_storage:
softhsm_tokens:
driver: local
diff --git a/docs/docs.json b/docs/docs.json
index a41a09eac7..76ba0ac1cf 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -251,6 +251,7 @@
},
"documentation/platform/sso/auth0-oidc",
"documentation/platform/sso/pingone-oidc",
+ "documentation/platform/sso/pingfederate-oidc",
{
"group": "General OIDC",
"pages": [
@@ -279,6 +280,7 @@
"documentation/platform/scim/azure",
"documentation/platform/scim/jumpcloud",
"documentation/platform/scim/pingone",
+ "documentation/platform/scim/pingfederate",
"documentation/platform/scim/group-mappings"
]
},
diff --git a/docs/documentation/platform/scim/pingfederate.mdx b/docs/documentation/platform/scim/pingfederate.mdx
new file mode 100644
index 0000000000..0365a46963
--- /dev/null
+++ b/docs/documentation/platform/scim/pingfederate.mdx
@@ -0,0 +1,410 @@
+---
+title: "PingFederate SCIM"
+description: "Learn how to configure SCIM provisioning with PingFederate for Infisical."
+---
+
+<Info>
+ PingFederate SCIM provisioning is a paid feature.
+
+ If you're using Infisical Cloud, then it is available under the **Enterprise Tier**. If you're self-hosting Infisical,
+ then you should contact [email protected] to purchase a self-hosted license to use it.
+</Info>
+
+<Note>
+ Unlike PingOne, PingFederate is a self-hosted product. The setup below assumes you already have a running PingFederate
+ instance reachable from the server that hosts your Infisical deployment. This guide covers PingFederate 13.x; earlier
+ versions use the same conceptual steps but the menu labels may differ slightly.
+</Note>
+
+Prerequisites:
+- A running PingFederate 11.x or later installation with the Outbound Provisioning role licensed.
+- An external RDBMS (PostgreSQL, MySQL, Oracle, or SQL Server) to back the PingFederate Provisioner Data Store. Required for any non-trivial install — the embedded H2 store should only be used for local testing.
+- An Active Directory (or other LDAP) directory containing the users you want to provision, reachable from PingFederate over LDAP/LDAPS. A read-only service account with permission to query the user subtree is sufficient.
+- PingFederate's runtime must be able to reach your Infisical deployment over HTTPS at the SCIM URL Infisical issues. If PingFederate runs in a different network zone than Infisical, ensure firewall rules and DNS resolution are in place before continuing.
+- On the Infisical side, the organization must already have **SAML or OIDC SSO configured** and at least one **verified email domain** (**Settings → Organization → Email Domains**).
+
+<Steps>
+ <Step title="Install the PingFederate SCIM Connector Add-on">
+ Infisical requires **SCIM 2.0**. PingFederate's bundled template is SCIM 1.1 only — install the SCIM Connector Add-on to add SCIM 2.0 support.
+
+ **1. Download the connector**
+
+ Sign in at [pingidentity.com](https://www.pingidentity.com) with the email tied to your PingFederate license, then
+ open the [PingFederate downloads page](https://www.pingidentity.com/en/resources/downloads/pingfederate.html).
+ Click the **Add-ons** tab. Under **SaaS Connectors**, download the **SCIM Connector** `.zip`.
+
+ ![Download SCIM connector](/images/platform/scim/pingfederate/download-scim-connector.png)
+
+ **2. Install the connector**
+
+ Extract the `.zip`. Inside you'll find a `dist/` directory containing a single jar named
+ `pf-scim-quickconnection-<version>.jar`.
+
+ Stop PingFederate and copy that jar into `<pf-install>/server/default/deploy/`. Leave PingFederate stopped — the next step edits another config file.
+ </Step>
+
+ <Step title="Enable the Outbound Provisioning runtime in PingFederate">
+ PingFederate ships with the provisioning runtime **disabled** by default. You must enable it before any SCIM channel
+ will run.
+
+ Edit `<pf-install>/bin/run.properties` and change:
+
+ ```properties
+ pf.provisioner.mode=OFF
+ ```
+
+ to:
+
+ ```properties
+ pf.provisioner.mode=STANDALONE
+ ```
+
+ Use `STANDALONE` for a single-node install. For high availability, see Ping's [Deploying provisioning failover](https://docs.pingidentity.com/pingfederate/13.0/server_clustering_guide/pf_deploy_provis_failover.html) guide.
+
+ Start PingFederate.
+
+ <Info>
+ To verify the SCIM Connector is now available, go to **Applications → Integration → SP Connections → Create Connection → Connection Type tab**, check **Outbound Provisioning**, and open the **Type** dropdown — you should see **SCIM 2.0 Service Provider** alongside the bundled SCIM 1.1 entry. If you only see SCIM 1.1, check PingFederate's `server.log` for connector load errors. Cancel out of the wizard once you've confirmed; you'll return to it in a later step.
+
+ ![Connector installed](/images/platform/scim/pingfederate/connector-confirmation.png)
+ </Info>
+ </Step>
+
+ <Step title="Configure the Provisioner Data Store">
+ PingFederate persists provisioning state (last-sync timestamps, externalId mappings, etc.) in a dedicated database.
+ This is **separate** from your user source — it's PingFederate's internal bookkeeping. The provisioner data store
+ must be a JDBC database; LDAP data stores cannot be used for this purpose.
+
+ 1. Create an empty schema in your RDBMS for PingFederate's provisioner state.
+ 2. Run the schema script that matches your RDBMS against that schema. The scripts ship with PingFederate and live at `<pf-install>/server/default/conf/provisioner/sql-scripts/`:
+ - `provisioner-mssql.sql` — SQL Server
+ - `provisioner-mysql.sql` — MySQL
+ - `provisioner-oracle.sql` — Oracle
+ - `provisioner-postgresql.sql` — PostgreSQL
+ 3. Install the JDBC driver for your database. PingFederate only bundles the H2 driver — other databases require you to download the driver `.jar` from the vendor and copy it into `<pf-install>/server/default/lib/`, then restart PingFederate. If you skip this step, the Add Data Store step will fail with "You must provide a valid driver class name" even when the class name is correct.
+ 4. In the PingFederate admin console: **System → Data Stores → Add Data Store → JDBC**. Configure the connection and save.
+ ![Add data store step 1](/images/platform/scim/pingfederate/data-store-step-3-1.png)
+ ![Add data store step 2](/images/platform/scim/pingfederate/data-store-step-3-2.png)
+ ![Add data store step 3](/images/platform/scim/pingfederate/data-store-step-3-3.png)
+ ![Add data store step 4](/images/platform/scim/pingfederate/data-store-step-3-4.png)
+ 5. Go to **System → Server → Protocol Settings → Outbound Provisioning** and select the JDBC data store you just created as the **Provisioner Data Store**. Save.
+
+ ![Set data store](/images/platform/scim/pingfederate/data-store-step-4.png)
+
+ Leave the **Synchronization Frequency** at the default 60 seconds unless you have a reason to change it.
+ </Step>
+
+ <Step title="Add your LDAP directory as a Data Store">
+ PingFederate's SCIM channel pulls users from a **source** Data Store and provisions them outbound to Infisical.
+ Most deployments use Active Directory as the source — these steps assume AD or another LDAP directory. If you
+ provision users from a relational database instead, see the JDBC note at the end of this step.
+
+ In the PingFederate admin console: **System → Data Stores → Add New Data Store** → select **LDAP**.
+
+ ![Add directory step 1](/images/platform/scim/pingfederate/directory-step-1.png)
+
+ ![Add directory step 2](/images/platform/scim/pingfederate/directory-step-2.png)
+
+ - **LDAP Type**: select **Active Directory** (or **Generic** / **Oracle Directory Server** / etc. for non-AD directories). The LDAP Type affects which attribute behaviors PingFederate assumes (binary handling for AD's `objectGUID`, etc.) — picking the wrong one will silently produce incorrect change detection.
+
+ Fill out the Data Store form:
+
+ ![Add directory step 3](/images/platform/scim/pingfederate/directory-step-3.png)
+
+ - **Hostname**: your AD / LDAP server (e.g. `ad.corp.example.com`). For HA, add multiple hosts. Click **Add** to commit each hostname into the list.
+ - **Use LDAPS** (recommended) or **Use StartTLS**: enable one if your directory supports TLS. If using LDAPS, ensure the directory's CA certificate is trusted by PingFederate (Security → Certificate & Key Management → Trusted CAs).
+ - **Authentication Method**: Simple.
+ - **User DN**: a service account DN with read access to the user subtree, e.g. `CN=pf-svc,OU=Service Accounts,DC=corp,DC=example,DC=com`.
+ - **Password**: the service account password.
+
+ Click **Test Connection**. PingFederate should return "Connection Successful." If not, the bind credentials or
+ network reachability is wrong — fix that before continuing.
+
+ Save the Data Store.
+
+ ![Add directory step 4](/images/platform/scim/pingfederate/directory-step-4.png)
+
+ <Note>
+ **Using JDBC instead?** Choose **Database** rather than **LDAP** at the Add Data Store step and configure the
+ JDBC URL, driver, and credentials for your user table. The rest of this guide is otherwise identical, except
+ the source attribute names in the channel mapping table (Step 8) will be your **column names** instead of
+ LDAP attribute names.
+ </Note>
+ </Step>
+
+ <Step title="Generate a SCIM token in Infisical">
+ In Infisical, head to the **Organization Settings** page and select the **Provisioning** tab. Under SCIM Configuration,
+ press the **Enable SCIM provisioning** toggle to allow PingFederate to provision/deprovision users for your organization.
+
+ ![SCIM enable provisioning](/images/platform/scim/scim-enable-provisioning-new.png)
+
+ Press **Configure** and then **Create** to generate a SCIM token for PingFederate.
+
+ ![SCIM create token](/images/platform/scim/scim-create-token.png)
+
+ Copy the **SCIM URL** and **New SCIM Token** — you'll paste them into PingFederate's SP Connection in a later step.
+ The token is shown once and cannot be retrieved again.
+
+ ![SCIM copy token](/images/platform/scim/scim-copy-token.png)
+ </Step>
+
+ <Step title="Create the SP Connection">
+ Navigate to **Applications → Integration → SP Connections** and click **Create Connection**.
+
+ ![Sp connections tab](/images/platform/scim/pingfederate/connection-step-1.png)
+
+ **1. Connection Template tab**
+
+ Select **USE A TEMPLATE FOR THIS CONNECTION** → from the dropdown, pick **SCIM Connector** → Next.
+
+ ![template tab](/images/platform/scim/pingfederate/connection-step-2.png)
+
+ **2. Connection Type tab**
+
+ - Check **Outbound Provisioning**.
+ - The **Type** dropdown that appears next to Outbound Provisioning should say **SCIM Connector**.
+ - Click Next.
+
+ ![Outbound provision tab](/images/platform/scim/pingfederate/connection-step-3.png)
+
+ **3. General Info tab**
+
+ - **Partner's Entity ID (Connection ID)**: e.g. `infisical-scim`.
+ - **Connection Name**: e.g. `Infisical SCIM`.
+ - Leave the rest (Base URL, Company, Contact, Application metadata) empty or default.
+ - Click Next.
+
+ ![General tab](/images/platform/scim/pingfederate/connection-step-4.png)
+
+ **4. Outbound Provisioning tab**
+
+ Click **Configure Provisioning** — this opens the Target / Channel configuration wizard, which we cover in the next two steps.
+
+ ![configure provisioning tab](/images/platform/scim/pingfederate/connection-step-5.png)
+
+ </Step>
+
+ <Step title="Configure the SCIM target">
+ Inside the Configure Provisioning wizard, the first tab is **Target** — this is where you tell PingFederate how to reach Infisical.
+
+ | Field | Value |
+ |---|---|
+ | **SCIM URL** | The SCIM URL you copied from Infisical in Step 5 |
+ | **SCIM Version** | `2.0` |
+ | **Authentication Method** | `OAuth 2 Bearer Token` |
+ | **Access Token** (under OAUTH 2 BEARER TOKEN) | The SCIM token you copied from Infisical |
+ | **Unique User Identifier** | `userName` |
+ | **Filter Expression** | `userName eq "%s"` |
+ | **Authorization Header Type** | leave blank (defaults to `Bearer`) |
+ | **Users API Path / Groups API Path** | leave blank (defaults to `/Users` and `/Groups`) |
+ | **Results Per Page** | `1000` |
+ | **Provisioning Options → User Create / User Update / User Disable-Delete** | all checked |
+ | **Provision Disabled Users** | unchecked |
+ | **Remove User Action** | `Disable` for a first run (changes deprovisioned users to inactive in Infisical rather than hard-deleting them). Switch to `Delete` later if you want true hard deprovisioning. |
+ | **Group Name Source** | `Common Name` |
+ | **Use PATCH for Group Updates** | Optional, but recommended if you provision groups. |
+
+ Leave the Basic Authentication and OAuth 2 Client Credentials sections empty — only OAuth 2 Bearer Token is used.
+
+ ![configure scim target 1](/images/platform/scim/pingfederate/connection-step-6-1.png)
+ ![configure scim target 2](/images/platform/scim/pingfederate/connection-step-6-2.png)
+
+ <Warning>
+ **The SCIM URL host must be reachable from the PingFederate runtime, not from your browser.** If PingFederate
+ runs on a different host than Infisical, make sure the hostname in the SCIM URL is one PingFederate's container
+ or server can actually resolve and connect to — not just one you can hit from your laptop. If you see
+ "Connection refused" errors in PingFederate's `provisioner.log`, this is almost always why.
+ </Warning>
+
+ Click Next to move on to the channel configuration.
+ </Step>
+
+ <Step title="Configure the SCIM channel">
+ On the Manage Channels tab, click **Create**. This opens the per-channel wizard with six tabs.
+
+ ![create channel](/images/platform/scim/pingfederate/channel-step-1.png)
+
+ **1. Channel Info**
+
+ - **Channel Name**: `infisical-users` (or any identifier).
+ - **Max Threads**: `1` for dev, increase for production as needed.
+ - **Timeout (Secs)**: `60` (default).
+
+ ![channel info](/images/platform/scim/pingfederate/channel-step-2.png)
+
+ **2. Source**
+
+ - **Active Data Store**: select the LDAP data store you configured in Step 4.
+
+ ![active data store](/images/platform/scim/pingfederate/channel-step-3.png)
+
+ **3. Source Settings**
+
+ This tab tells PingFederate how to detect changes and identify users in your LDAP source.
+
+ | Field | Value (AD) | Value (Generic LDAP / OpenLDAP) |
+ |---|---|---|
+ | **Entry GUID Attribute** | `objectGUID` | `entryUUID` |
+ | **GUID Type** | `Binary` | `Text` |
+ | **Member of Group Attribute** | `memberOf` | `memberOf` (if the `memberof` overlay is enabled) — otherwise leave blank |
+ | **Group Member Attribute** | `member` | `member` |
+ | **User Objectclass** | `user` | `inetOrgPerson` |
+ | **Group Objectclass** | `group` | `groupOfNames` |
+ | **Changed Users/Groups Algorithm** | `USN` (AD-specific) or `Timestamp` | `Timestamp` |
+ | **USN Attribute** (only if USN algorithm) | `uSNChanged` | n/a |
+ | **Timestamp Attribute** (only if Timestamp algorithm) | `whenChanged` | `modifyTimestamp` |
+ | **Account Status Attribute** | `userAccountControl` | varies by directory (e.g. `pwdAccountLockedTime` if password policy overlay) |
+ | **Account Status Algorithm** | `Flag` | `Flag` |
+ | **Default Status** | `true` (users active by default) | `true` |
+ | **Flag Comparison Value** | `514` (the disabled bit) | varies |
+ | **Flag Comparison Status** | `false` (when flag matches, user is inactive) | `false` |
+
+ ![source settings 1](/images/platform/scim/pingfederate/channel-step-4.png)
+ ![source settings 2](/images/platform/scim/pingfederate/channel-step-5.png)
+
+ <Note>
+ **At least one of Member of Group Attribute or Group Member Attribute is required**, even if you're not actually provisioning groups. Fill in `member` for Group Member Attribute as a safe default if you don't plan to use the values.
+ </Note>
+
+ <Warning>
+ **With the `Active Directory USN` algorithm, point the LDAP data store at a single domain controller.** `uSNChanged` is a per-DC counter that AD does **not** replicate, so if PingFederate spreads queries across multiple DCs (e.g. the multi-host HA setup in Step 4) it can read a different DC than the one whose USN it last recorded and silently miss changes. For a multi-DC / HA source, either pin the data store to one DC, or switch **Changed Users/Groups Algorithm** to `Timestamp` with **Timestamp Attribute** `whenChanged` (which *is* replicated).
+ </Warning>
+
+ **4. Source Location**
+
+ - **Base DN**: the search root for *both* users and groups — it must contain both (use a common ancestor like the domain root if they're in different OUs). e.g. `CN=Users,DC=corp,DC=example,DC=com` for AD.
+ - **Users → Group DN**: leave blank, or set to a group to provision only its members.
+ - **Users → Filter**: AD `(&(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))` (enabled users); OpenLDAP `(objectClass=inetOrgPerson)`.
+ - **Groups → Filter** (only if provisioning groups): AD `(objectClass=group)`; OpenLDAP `(objectClass=groupOfNames)` — **scope it** (e.g. `(&(objectClass=group)(cn=infisical-*))`) or you'll also pull AD's built-in groups. Leave **Group DN** and **Nested Search** empty (Infisical doesn't support nested groups).
+
+ ![source location](/images/platform/scim/pingfederate/channel-step-6.png)
+
+ <Note>
+ Infisical groups are flat — members are users only (nested groups are ignored), and a member resolves only if that user was also provisioned, so keep group members in your **Users** scope. The group's CN (set by **Group Name Source**, Step 7) is what you map under **Settings → Provisioning → SCIM Group to Organization Role Mappings**.
+ </Note>
+
+ **5. Attribute Mapping**
+
+ Click **Edit** on each SCIM field below. The edit form has two dropdowns: **Root Object Class** and **Attribute**.
+
+ <Note>
+ **Attribute mapping trap**: the Root Object Class dropdown only shows attributes defined *directly* on that
+ class — it does **not** show inherited attributes. For LDAP, `sn` is defined on the `person` class and inherited
+ by `inetOrgPerson`. So mapping `familyName` requires selecting Root Object Class = `person`, not `inetOrgPerson`.
+ If the attribute you expect is missing from the dropdown, try a parent object class.
+ </Note>
+
+ The minimum set Infisical requires:
+
+ | SCIM Field | Root Object Class (AD) | Attribute (AD) | Root Object Class (LDAP) | Attribute (LDAP) |
+ |---|---|---|---|---|
+ | `userName` | `user` | `userPrincipalName` (or `mail`) | `inetOrgPerson` | `mail` |
+ | `workEmail` | `user` | `mail` | `inetOrgPerson` | `mail` |
+ | `givenName` | `user` | `givenName` | `inetOrgPerson` | `givenName` |
+ | `familyName` | `user` | `sn` | `person` | `sn` |
+
+ For each row: click **Edit** → pick **Root Object Class** → pick **Attribute** → click **Add Attribute** → click **Done**.
+
+ `active` doesn't need an explicit mapping — PingFederate derives it from the Account Status Attribute settings in Source Settings.
+
+ ![attribute mapping 1](/images/platform/scim/pingfederate/channel-step-7.png)
+ ![attribute mapping 2](/images/platform/scim/pingfederate/channel-step-8.png)
+
+ <Note>
+ The `userName`'s email domain **must be a verified email domain** for your Infisical organization
+ (**Settings → Organization → Email Domains**). If it isn't, SCIM user creation is **rejected** with a
+ `403 – "…not a part of the accepted domains…"` and the user is **not** created — groups have no such check, so
+ you'll see the group sync without its members. Verify the domain **before** provisioning.
+ </Note>
+
+ **6. Activation & Summary**
+
+ - Set **Channel Status** to `Active`.
+ - Scroll through the summary and confirm Source Settings, Source Location, and Attribute Mapping all reflect what you intended.
+ - Click **Done**.
+
+ ![activate channel 1](/images/platform/scim/pingfederate/channel-step-9.png)
+ ![activate channel 2](/images/platform/scim/pingfederate/channel-step-10.png)
+ </Step>
+
+ <Step title="Activate the SP Connection">
+ After saving the channel you'll be back on Configure Channels. Click **Done** to close that screen.
+
+ ![channel done](/images/platform/scim/pingfederate/channel-step-11.png)
+
+ On the parent SP Connection wizard's **Outbound Provisioning** tab, click **Next**.
+
+ ![connection next](/images/platform/scim/pingfederate/connection-step-7.png)
+
+ On **Activation & Summary**:
+ - Set **Connection Status** to `Active`.
+ - Review the summary.
+ - Click **Save**.
+
+ ![connection enable](/images/platform/scim/pingfederate/connection-step-8.png)
+ ![connection save](/images/platform/scim/pingfederate/connection-step-9.png)
+
+ <Warning>
+ **Both the channel AND the parent SP Connection must be Active.** If either one is Inactive, provisioning silently does nothing — there's no error in the UI. Double-check both before troubleshooting other things.
+ </Warning>
+ </Step>
+
+ <Step title="Verify provisioning works">
+ PingFederate runs the channel on the cadence set in **System → Server → Protocol Settings → Outbound Provisioning → Synchronization Frequency** (default 60 seconds). The first sync should run within that window of activation.
+
+ Verify on three levels:
+
+ **1. PingFederate's provisioner log**
+
+ Tail `<pf-install>/log/provisioner.log`. Look for lines like:
+
+ ```
+ [GenericUserProvisioningChannel] Starting provisioning cycle for channel: infisical-users
+ [ProvisioningEventLogger] Finished pushing user/group updates to the target. Completed in 331 ms. Total users created 2.
+ ```
+
+ If you see `Connection refused` or `Service Unavailable` errors, the SCIM URL host isn't reachable from PingFederate — re-check Step 7.
+
+ **2. Infisical's user list**
+
+ Go to **Settings → Organization → Access Control → Users**. Provisioned users appear as pending (invited) accounts.
+
+ **3. Infisical's SCIM event log**
+
+ Go to **Organization Settings → Provisioning → SCIM Events**. Each successful POST/PUT/PATCH from PingFederate appears here with the SCIM payload — useful for diagnosing attribute-mapping mistakes.
+ </Step>
+</Steps>
+
+## Troubleshooting
+
+<AccordionGroup>
+<Accordion title="provisioner.log shows: Connection refused / Service Unavailable">
+ PingFederate can't reach the host in your SCIM URL. The most common causes:
+
+ - The SCIM URL uses `localhost` or `127.0.0.1` but PingFederate runs in a different container or on a different host.
+ - DNS doesn't resolve the host from PingFederate's network zone.
+ - A firewall is blocking outbound HTTPS from PingFederate to Infisical.
+
+ Fix the SCIM URL on the **Target** tab (SP Connection → Outbound Provisioning → Configure Provisioning → Target). The next sync (within the configured frequency) will use the new URL.
+</Accordion>
+
+<Accordion title="Sync runs successfully but Total users created is 0">
+ Either no users matched your **Source Location → Filter**, or every matching user already exists in Infisical (PingFederate tracks this in its Provisioner Data Store and skips re-creation).
+
+ To diagnose: search PingFederate's `provisioner.log` for `Processed N users` and `Users added: N` lines from the most recent cycle. A zero `Users added` count means the filter is too restrictive or change-detection thinks nothing has changed.
+
+ To force a re-provision: delete the entry for that channel from the Provisioner Data Store's tracking tables, then trigger a new sync. (For development only — never do this in production.)
+</Accordion>
+
+<Accordion title="Only SCIM 1.1 Service Provider appears in the Connection Type dropdown">
+ The SCIM Connector Add-on isn't loaded. Re-check Step 1 — confirm the jar landed in `<pf-install>/server/default/deploy/`, PingFederate was restarted after the copy, and `server.log` has no errors loading the connector.
+</Accordion>
+
+<Accordion title="LDAP attribute isn't appearing in the Attribute Mapping edit dropdown">
+ The Root Object Class dropdown only exposes attributes defined directly on that class — not inherited ones. Common case: `sn` is defined on `person`, not `inetOrgPerson` or `user`. Change the Root Object Class to the parent class that actually defines the attribute.
+</Accordion>
+
+<Accordion title="Provisioning runs but no users land in Infisical, no errors in the logs">
+ Most likely: either the channel or the parent SP Connection is still in `Inactive` status. Both must be Active. Confirm in both **Configure Provisioning → Manage Channels** (channel status column) and **SP Connections** list (connection status column).
+</Accordion>
+</AccordionGroup>
diff --git a/docs/images/platform/scim/pingfederate/channel-step-1.png b/docs/images/platform/scim/pingfederate/channel-step-1.png
new file mode 100644
index 0000000000..5d7e4ab64a
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-1.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-10.png b/docs/images/platform/scim/pingfederate/channel-step-10.png
new file mode 100644
index 0000000000..a65bfaaaa3
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-10.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-11.png b/docs/images/platform/scim/pingfederate/channel-step-11.png
new file mode 100644
index 0000000000..b0bc17f14a
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-11.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-2.png b/docs/images/platform/scim/pingfederate/channel-step-2.png
new file mode 100644
index 0000000000..d07c457bea
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-2.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-3.png b/docs/images/platform/scim/pingfederate/channel-step-3.png
new file mode 100644
index 0000000000..3bdfca5051
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-3.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-4.png b/docs/images/platform/scim/pingfederate/channel-step-4.png
new file mode 100644
index 0000000000..733ac8f37c
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-4.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-5.png b/docs/images/platform/scim/pingfederate/channel-step-5.png
new file mode 100644
index 0000000000..a955ad9e34
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-5.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-6.png b/docs/images/platform/scim/pingfederate/channel-step-6.png
new file mode 100644
index 0000000000..8b35a635db
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-6.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-7.png b/docs/images/platform/scim/pingfederate/channel-step-7.png
new file mode 100644
index 0000000000..d469503541
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-7.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-8.png b/docs/images/platform/scim/pingfederate/channel-step-8.png
new file mode 100644
index 0000000000..fa5d37a6d0
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-8.png differ
diff --git a/docs/images/platform/scim/pingfederate/channel-step-9.png b/docs/images/platform/scim/pingfederate/channel-step-9.png
new file mode 100644
index 0000000000..4e0f29d19b
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/channel-step-9.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-1.png b/docs/images/platform/scim/pingfederate/connection-step-1.png
new file mode 100644
index 0000000000..1cd5ee2874
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-1.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-2.png b/docs/images/platform/scim/pingfederate/connection-step-2.png
new file mode 100644
index 0000000000..8e10cb1cf1
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-2.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-3.png b/docs/images/platform/scim/pingfederate/connection-step-3.png
new file mode 100644
index 0000000000..6c9bd6d4eb
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-3.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-4.png b/docs/images/platform/scim/pingfederate/connection-step-4.png
new file mode 100644
index 0000000000..7b49980ec8
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-4.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-5.png b/docs/images/platform/scim/pingfederate/connection-step-5.png
new file mode 100644
index 0000000000..a93713be2c
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-5.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-6-1.png b/docs/images/platform/scim/pingfederate/connection-step-6-1.png
new file mode 100644
index 0000000000..ef412a3d4e
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-6-1.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-6-2.png b/docs/images/platform/scim/pingfederate/connection-step-6-2.png
new file mode 100644
index 0000000000..1e2eb2cc3e
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-6-2.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-7.png b/docs/images/platform/scim/pingfederate/connection-step-7.png
new file mode 100644
index 0000000000..f2615554ba
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-7.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-8.png b/docs/images/platform/scim/pingfederate/connection-step-8.png
new file mode 100644
index 0000000000..1e4dd75dd8
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-8.png differ
diff --git a/docs/images/platform/scim/pingfederate/connection-step-9.png b/docs/images/platform/scim/pingfederate/connection-step-9.png
new file mode 100644
index 0000000000..f908bd3c65
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connection-step-9.png differ
diff --git a/docs/images/platform/scim/pingfederate/connector-confirmation.png b/docs/images/platform/scim/pingfederate/connector-confirmation.png
new file mode 100644
index 0000000000..f3fb36530f
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/connector-confirmation.png differ
diff --git a/docs/images/platform/scim/pingfederate/data-store-step-3-1.png b/docs/images/platform/scim/pingfederate/data-store-step-3-1.png
new file mode 100644
index 0000000000..2c7c467ac7
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/data-store-step-3-1.png differ
diff --git a/docs/images/platform/scim/pingfederate/data-store-step-3-2.png b/docs/images/platform/scim/pingfederate/data-store-step-3-2.png
new file mode 100644
index 0000000000..cd3208067d
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/data-store-step-3-2.png differ
diff --git a/docs/images/platform/scim/pingfederate/data-store-step-3-3.png b/docs/images/platform/scim/pingfederate/data-store-step-3-3.png
new file mode 100644
index 0000000000..a12024edb9
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/data-store-step-3-3.png differ
diff --git a/docs/images/platform/scim/pingfederate/data-store-step-3-4.png b/docs/images/platform/scim/pingfederate/data-store-step-3-4.png
new file mode 100644
index 0000000000..f343babf75
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/data-store-step-3-4.png differ
diff --git a/docs/images/platform/scim/pingfederate/data-store-step-4.png b/docs/images/platform/scim/pingfederate/data-store-step-4.png
new file mode 100644
index 0000000000..ba76918836
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/data-store-step-4.png differ
diff --git a/docs/images/platform/scim/pingfederate/directory-step-1.png b/docs/images/platform/scim/pingfederate/directory-step-1.png
new file mode 100644
index 0000000000..2c7c467ac7
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/directory-step-1.png differ
diff --git a/docs/images/platform/scim/pingfederate/directory-step-2.png b/docs/images/platform/scim/pingfederate/directory-step-2.png
new file mode 100644
index 0000000000..5cae713b33
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/directory-step-2.png differ
diff --git a/docs/images/platform/scim/pingfederate/directory-step-3.png b/docs/images/platform/scim/pingfederate/directory-step-3.png
new file mode 100644
index 0000000000..6c7b3e30a2
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/directory-step-3.png differ
diff --git a/docs/images/platform/scim/pingfederate/directory-step-4.png b/docs/images/platform/scim/pingfederate/directory-step-4.png
new file mode 100644
index 0000000000..19d3ff6fe7
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/directory-step-4.png differ
diff --git a/docs/images/platform/scim/pingfederate/download-scim-connector.png b/docs/images/platform/scim/pingfederate/download-scim-connector.png
new file mode 100644
index 0000000000..5c9d0deacc
Binary files /dev/null and b/docs/images/platform/scim/pingfederate/download-scim-connector.png differ
diff --git a/docs/images/platform/scim/scim-copy-token.png b/docs/images/platform/scim/scim-copy-token.png
index d3a4586c28..3f5800a439 100644
Binary files a/docs/images/platform/scim/scim-copy-token.png and b/docs/images/platform/scim/scim-copy-token.png differ
diff --git a/docs/images/platform/scim/scim-create-token.png b/docs/images/platform/scim/scim-create-token.png
index 9fe4eac3e9..b47dfba360 100644
Binary files a/docs/images/platform/scim/scim-create-token.png and b/docs/images/platform/scim/scim-create-token.png differ
diff --git a/docs/images/platform/scim/scim-enable-provisioning-new.png b/docs/images/platform/scim/scim-enable-provisioning-new.png
new file mode 100644
index 0000000000..8a9249279a
Binary files /dev/null and b/docs/images/platform/scim/scim-enable-provisioning-new.png differ
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ExternalGroupOrgRoleMappings.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ExternalGroupOrgRoleMappings.tsx
index bc9a029211..05e05e661e 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ExternalGroupOrgRoleMappings.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ExternalGroupOrgRoleMappings.tsx
@@ -1,22 +1,28 @@
import { useEffect } from "react";
import { Controller, useFieldArray, useForm } from "react-hook-form";
-import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
+import { Info, Plus, Trash2 } from "lucide-react";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
Button,
- FormControl,
- FormLabel,
+ Field,
+ FieldError,
+ FieldLabel,
IconButton,
Input,
Select,
+ SelectContent,
SelectItem,
- Spinner
-} from "@app/components/v2";
+ SelectTrigger,
+ SelectValue,
+ Skeleton,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -85,94 +91,106 @@ export const ExternalGroupOrgRoleMappings = () => {
const disableScimEdit = permission.cannot(OrgPermissionActions.Edit, OrgPermissionSubjects.Scim);
return (
- <div className="py-4">
- <h2 className="text-md text-mineshaft-100">SCIM Group to Organization Role Mappings</h2>
- <p className="text-sm text-mineshaft-300">
+ <div>
+ <h3 className="text-sm font-medium text-foreground">
+ SCIM Group to Organization Role Mappings
+ </h3>
+ <p className="text-xs text-muted">
Assign newly provisioned users a default organization role based on their SCIM group.
</p>
<form onSubmit={handleSubmit(handleUpdateMappings)} className="pt-4">
- {isRolesLoading || isRolesLoading ? (
- <Spinner className="self-center" size="sm" />
+ {isRolesLoading ? (
+ <div className="flex flex-col gap-2">
+ {Array.from({ length: 2 }).map((_, idx) => (
+ // eslint-disable-next-line react/no-array-index-key
+ <Skeleton key={`mapping-skeleton-${idx}`} className="h-9 w-full" />
+ ))}
+ </div>
) : (
- <div className="mb-2 flex flex-col space-y-2">
+ <div className="flex flex-col gap-2">
{mappingField.fields.map(({ id: scopeFieldId }, i) => (
- <div key={scopeFieldId} className="flex items-end space-x-2">
- <div className="grow">
- {i === 0 && (
- <FormLabel
- label="SCIM Group Name"
- className="text-xs text-mineshaft-400"
- tooltipClassName="max-w-md whitespace-pre-line"
- tooltipText="The name associated with this group in your SCIM provider"
- />
- )}
- <Controller
- control={control}
- name={`mappings.${i}.groupName`}
- render={({ field, fieldState: { error } }) => (
- <FormControl
+ <div key={scopeFieldId} className="flex items-start gap-2">
+ <Controller
+ control={control}
+ name={`mappings.${i}.groupName`}
+ render={({ field, fieldState: { error } }) => (
+ <Field className="al flex-1">
+ {i === 0 && (
+ <FieldLabel
+ htmlFor={`mappings.${i}.groupName`}
+ className="flex items-center gap-1.5"
+ >
+ SCIM Group Name
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span>
+ <Info className="size-3 text-muted" />
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-md whitespace-pre-line">
+ The name associated with this group in your SCIM provider
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ )}
+ <Input
+ id={`mappings.${i}.groupName`}
isError={Boolean(error?.message)}
- errorText={error?.message}
- className="mb-0 grow"
- >
- <Input
- isDisabled={disableScimEdit}
- {...field}
- placeholder="SCIM group identifier..."
- />
- </FormControl>
- )}
- />
- </div>
- <div className="flex-1">
- {i === 0 && (
- <span className="text-xs text-mineshaft-400">
- Role to Assign Users in this Group
- </span>
+ disabled={disableScimEdit}
+ placeholder="SCIM group identifier..."
+ {...field}
+ />
+ <FieldError>{error?.message}</FieldError>
+ </Field>
)}
- <Controller
- control={control}
- name={`mappings.${i}.roleSlug`}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- isError={Boolean(error?.message)}
- errorText={error?.message}
- className="mb-0 grow"
- >
- <Select
- isDisabled={disableScimEdit}
- {...field}
- onValueChange={(e) => field.onChange(e)}
+ />
+ <Controller
+ control={control}
+ name={`mappings.${i}.roleSlug`}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="flex-1">
+ {i === 0 && (
+ <FieldLabel htmlFor={`mappings.${i}.roleSlug`}>
+ Role to Assign Users in this Group
+ </FieldLabel>
+ )}
+ <Select value={value} onValueChange={onChange} disabled={disableScimEdit}>
+ <SelectTrigger
+ id={`mappings.${i}.roleSlug`}
+ isError={Boolean(error?.message)}
className="w-full"
>
+ <SelectValue placeholder="Select role" />
+ </SelectTrigger>
+ <SelectContent>
{roles?.map((role) => (
<SelectItem value={role.slug} key={`role-${role.id}`}>
{role.name}
</SelectItem>
))}
- </Select>
- </FormControl>
- )}
- />
- </div>
+ </SelectContent>
+ </Select>
+ <FieldError>{error?.message}</FieldError>
+ </Field>
+ )}
+ />
<IconButton
- ariaLabel="delete key"
- className="bottom-0.5 h-9"
- variant="outline_bg"
+ variant="outline"
+ className={i === 0 ? "mt-6" : ""}
+ aria-label="Delete mapping"
isDisabled={disableScimEdit}
onClick={() => {
mappingField.remove(i);
}}
>
- <FontAwesomeIcon icon={faTrash} />
+ <Trash2 />
</IconButton>
</div>
))}
<div>
<Button
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
size="xs"
- variant="outline_bg"
+ variant="outline"
isDisabled={disableScimEdit}
onClick={() =>
mappingField.append({
@@ -184,6 +202,7 @@ export const ExternalGroupOrgRoleMappings = () => {
})
}
>
+ <Plus />
Add Mapping
</Button>
</div>
@@ -191,7 +210,12 @@ export const ExternalGroupOrgRoleMappings = () => {
<div className="flex w-full justify-end">
<OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Scim}>
{(isAllowed) => (
- <Button isDisabled={!isAllowed} colorSchema="secondary" type="submit">
+ <Button
+ isDisabled={!isAllowed}
+ variant="org"
+ type="submit"
+ isPending={updateMappings.isPending}
+ >
Update Mappings
</Button>
)}
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/GithubOrgSyncConfigModal.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/GithubOrgSyncConfigModal.tsx
index 868dd17f74..229258c88f 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/GithubOrgSyncConfigModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/GithubOrgSyncConfigModal.tsx
@@ -1,9 +1,34 @@
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
+import { Trash2 } from "lucide-react";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
-import { Button, DeleteActionModal, FormControl, Input } from "@app/components/v2";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogMedia,
+ AlertDialogTitle,
+ Button,
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ Field,
+ FieldDescription,
+ FieldError,
+ FieldGroup,
+ FieldLabel,
+ Input
+} from "@app/components/v3";
import {
useCreateGithubSyncOrgConfig,
useDeleteGithubSyncOrgConfig,
@@ -93,65 +118,107 @@ export const GithubOrgSyncConfigModal = ({
return (
<>
- <form onSubmit={handleSubmit(onFormSubmit)}>
- <Controller
- control={control}
- defaultValue=""
- name="githubOrgName"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="GitHub Organization Name"
- isError={Boolean(error)}
- errorText={error?.message}
- >
- <Input {...field} placeholder="example" />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- name="githubOrgAccessToken"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="GitHub Access Token"
- isError={Boolean(error)}
- isOptional
- errorText={error?.message}
- helperText="Required for manual sync operations. The token must have 'read:org' permissions."
- >
- <Input {...field} type="password" placeholder="ghp_xxxxxxxxxxxx" />
- </FormControl>
- )}
- />
- <div className="flex gap-8 pt-4">
- <Button type="submit" isLoading={isSubmitting} isDisabled={isSubmitting}>
- {isUpdate ? "Update" : "Configure"}
- </Button>
- <Button
- variant="plain"
- colorSchema="secondary"
- onClick={() => handlePopUpToggle("githubOrgSyncConfig", false)}
- >
- Cancel
- </Button>
- <div className="grow" />
- {isUpdate && (
- <Button
- onClick={() => handlePopUpOpen("deleteGithubOrgSyncConfig")}
- colorSchema="danger"
- >
- Delete
- </Button>
- )}
- </div>
- </form>
- <DeleteActionModal
- isOpen={popUp.deleteGithubOrgSyncConfig.isOpen}
- title="Are you sure you want to remove GitHub organization sync?"
- onChange={(isOpen) => handlePopUpToggle("deleteGithubOrgSyncConfig", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={onDelete}
- />
+ <Dialog
+ open={popUp?.githubOrgSyncConfig?.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("githubOrgSyncConfig", isOpen)}
+ >
+ <DialogContent className="max-w-lg">
+ <DialogHeader>
+ <DialogTitle>Manage GitHub Organization Sync</DialogTitle>
+ <DialogDescription>
+ Sync your GitHub teams to Infisical organization groups.
+ </DialogDescription>
+ </DialogHeader>
+ <form onSubmit={handleSubmit(onFormSubmit)}>
+ <FieldGroup>
+ <Controller
+ control={control}
+ defaultValue=""
+ name="githubOrgName"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel htmlFor="github-org-name">GitHub Organization Name</FieldLabel>
+ <Input
+ id="github-org-name"
+ placeholder="example"
+ isError={Boolean(error)}
+ {...field}
+ />
+ <FieldError>{error?.message}</FieldError>
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ defaultValue=""
+ name="githubOrgAccessToken"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel htmlFor="github-org-token">
+ GitHub Access Token (Optional)
+ </FieldLabel>
+ <Input
+ id="github-org-token"
+ type="password"
+ placeholder="ghp_xxxxxxxxxxxx"
+ isError={Boolean(error)}
+ {...field}
+ />
+ <FieldDescription>
+ Required for manual sync operations. The token must have &apos;read:org&apos;
+ permissions.
+ </FieldDescription>
+ <FieldError>{error?.message}</FieldError>
+ </Field>
+ )}
+ />
+ </FieldGroup>
+ <DialogFooter className="mt-6">
+ {isUpdate && (
+ <Button
+ type="button"
+ variant="danger"
+ className="mr-auto"
+ onClick={() => handlePopUpOpen("deleteGithubOrgSyncConfig")}
+ >
+ Delete
+ </Button>
+ )}
+ <DialogClose asChild>
+ <Button type="button" variant="ghost">
+ Cancel
+ </Button>
+ </DialogClose>
+ <Button type="submit" variant="org" isPending={isSubmitting}>
+ {isUpdate ? "Update" : "Configure"}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+
+ <AlertDialog
+ open={popUp.deleteGithubOrgSyncConfig.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteGithubOrgSyncConfig", isOpen)}
+ >
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogMedia>
+ <Trash2 />
+ </AlertDialogMedia>
+ <AlertDialogTitle>Remove GitHub Organization Sync?</AlertDialogTitle>
+ <AlertDialogDescription>
+ Organization members will no longer have their groups synced from GitHub teams.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogAction variant="danger" onClick={onDelete}>
+ Remove
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
</>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgGithubSyncSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgGithubSyncSection.tsx
index f2115df964..a2737bd6f9 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgGithubSyncSection.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgGithubSyncSection.tsx
@@ -1,9 +1,28 @@
import { useQuery } from "@tanstack/react-query";
+import { GitBranch } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Modal, ModalContent, Skeleton, Spinner, Switch } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Detail,
+ DetailLabel,
+ DetailValue,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldGroup,
+ FieldTitle,
+ Skeleton,
+ Switch
+} from "@app/components/v3";
import { OrgPermissionActions, OrgPermissionSubjects, useSubscription } from "@app/context";
import {
githubOrgSyncConfigQueryKeys,
@@ -74,17 +93,21 @@ export const OrgGithubSyncSection = () => {
};
return (
- <div className="mt-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
- <p className="text-xl font-medium text-gray-200">
- Sync user groups from your GitHub Organization
- </p>
- <div className="py-4">
- <div className="mb-2 flex items-center justify-between">
- <h2 className="text-md text-mineshaft-100">GitHub Organization</h2>
- <div className="flex gap-4">
+ <>
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <GitBranch className="size-4 text-accent" />
+ GitHub Organization Sync
+ </CardTitle>
+ <CardDescription>Sync user groups from your GitHub organization teams.</CardDescription>
+ <CardAction>
<OrgPermissionCan I={OrgPermissionActions.Read} a={OrgPermissionSubjects.GithubOrgSync}>
{(isAllowed) => (
<Button
+ variant="outline"
+ isDisabled={!isAllowed}
+ isPending={isPending}
onClick={() =>
subscription.githubOrgSync
? handlePopUpOpen("githubOrgSyncConfig")
@@ -92,98 +115,92 @@ export const OrgGithubSyncSection = () => {
isEnterpriseFeature: true
})
}
- colorSchema="secondary"
- isDisabled={!isAllowed}
- isLoading={isPending}
>
Configure
</Button>
)}
</OrgPermissionCan>
- </div>
- </div>
- <p className="text-sm text-mineshaft-300">
- {isPending ? <Skeleton /> : null}
- {data ? data?.githubOrgName : "Not configured"}
- </p>
- </div>
- {data && (
- <div className="py-4">
- <div className="mb-2 flex items-center justify-between">
- <h2 className="text-md text-mineshaft-100">Enable GitHub Sync</h2>
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.GithubOrgSync}>
- {(isAllowed) => (
- <Switch
- id="enable-sync"
- onCheckedChange={(value) =>
- updateGithubSyncOrgConfig.mutate({
- isActive: value
- })
- }
- isChecked={githubOrgSyncConfig?.data?.isActive ?? false}
- isDisabled={!isAllowed}
- >
- {updateGithubSyncOrgConfig?.isPending && <Spinner size="xs" />}
- </Switch>
+ </CardAction>
+ </CardHeader>
+ {(isPending || data) && (
+ <CardContent>
+ <FieldGroup>
+ <Detail>
+ <DetailLabel>GitHub Organization</DetailLabel>
+ <DetailValue>
+ {isPending ? <Skeleton className="h-5 w-40" /> : data?.githubOrgName}
+ </DetailValue>
+ </Detail>
+ {data && (
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle>Enable GitHub Sync</FieldTitle>
+ <FieldDescription>
+ Allow group provisioning/deprovisioning with GitHub.
+ </FieldDescription>
+ </FieldContent>
+ <OrgPermissionCan
+ I={OrgPermissionActions.Edit}
+ a={OrgPermissionSubjects.GithubOrgSync}
+ >
+ {(isAllowed) => (
+ <Switch
+ id="enable-sync"
+ variant="org"
+ checked={data.isActive}
+ onCheckedChange={(value) =>
+ updateGithubSyncOrgConfig.mutate({
+ isActive: value
+ })
+ }
+ disabled={!isAllowed || updateGithubSyncOrgConfig.isPending}
+ />
+ )}
+ </OrgPermissionCan>
+ </Field>
)}
- </OrgPermissionCan>
- </div>
- <p className="text-sm text-mineshaft-300">
- Allow group provisioning/deprovisioning with GitHub
- </p>
- </div>
- )}
- {data && data.isActive && (
- <div className="py-4">
- <div className="mb-2 flex items-center justify-between">
- <h2 className="text-md text-mineshaft-100">Sync Now</h2>
- <OrgPermissionCan
- I={OrgPermissionActions.Edit}
- a={OrgPermissionSubjects.GithubOrgSyncManual}
- >
- {(isAllowed) => (
- <Button
- onClick={() => handleBulkSync()}
- colorSchema="primary"
- variant="outline_bg"
- isDisabled={!isAllowed || syncAllTeamsMutation.isPending}
- isLoading={syncAllTeamsMutation.isPending}
- >
- Sync Now
- </Button>
+ {data && data.isActive && (
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle>Sync Now</FieldTitle>
+ <FieldDescription>
+ Manually sync GitHub teams for all organization members. This will update team
+ memberships for users who have previously logged in with GitHub.
+ </FieldDescription>
+ </FieldContent>
+ <OrgPermissionCan
+ I={OrgPermissionActions.Edit}
+ a={OrgPermissionSubjects.GithubOrgSyncManual}
+ >
+ {(isAllowed) => (
+ <Button
+ variant="outline"
+ isDisabled={!isAllowed || syncAllTeamsMutation.isPending}
+ isPending={syncAllTeamsMutation.isPending}
+ onClick={() => handleBulkSync()}
+ >
+ Sync Now
+ </Button>
+ )}
+ </OrgPermissionCan>
+ </Field>
)}
- </OrgPermissionCan>
- </div>
- <p className="text-sm text-mineshaft-300">
- Manually sync GitHub teams for all organization members. This will update team
- memberships for users who have previously logged in with GitHub.
- </p>
- </div>
- )}
- <Modal
- isOpen={popUp?.githubOrgSyncConfig?.isOpen}
- onOpenChange={(isOpen) => {
- handlePopUpToggle("githubOrgSyncConfig", isOpen);
- }}
- >
- <ModalContent
- title="Manage GitHub Organization Sync"
- subTitle="Sync your GitHub teams to Infisical organization groups"
- >
- <GithubOrgSyncConfigModal
- data={data}
- popUp={popUp}
- handlePopUpOpen={handlePopUpOpen}
- handlePopUpToggle={handlePopUpToggle}
- />
- </ModalContent>
- </Modal>
+ </FieldGroup>
+ </CardContent>
+ )}
+ </Card>
+ <GithubOrgSyncConfigModal
+ data={data}
+ popUp={popUp}
+ handlePopUpOpen={handlePopUpOpen}
+ handlePopUpToggle={handlePopUpToggle}
+ />
<UpgradePlanModal
isOpen={popUp.upgradePlan.isOpen}
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
text="Your current plan does not include access to GitHub Organization Sync. To unlock this feature, please upgrade to Infisical Enterprise plan."
isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature}
/>
- </div>
+ </>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgProvisioningTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgProvisioningTab.tsx
index 30a3b58120..4371c450e7 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgProvisioningTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgProvisioningTab.tsx
@@ -8,11 +8,11 @@ import { ScimEvents } from "./ScimEvents";
export const OrgProvisioningTab = withPermission(
() => {
return (
- <>
- <OrgScimSection />
+ <div className="flex flex-col gap-4">
<OrgGithubSyncSection />
+ <OrgScimSection />
<ScimEvents />
- </>
+ </div>
);
},
{ action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Scim }
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgSCIMSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgSCIMSection.tsx
index f7551d1e4d..f82ceac959 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgSCIMSection.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/OrgSCIMSection.tsx
@@ -1,7 +1,24 @@
+import { UserCog } from "lucide-react";
+
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { Button, Switch } from "@app/components/v2";
+import {
+ Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldGroup,
+ FieldTitle,
+ Separator,
+ Switch
+} from "@app/components/v3";
import {
OrgPermissionActions,
OrgPermissionSubjects,
@@ -56,52 +73,50 @@ export const OrgScimSection = () => {
};
return (
- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
- <p className="text-xl font-medium text-gray-200">Provision users via SCIM</p>
- <div className="py-4">
- <div className="mb-2 flex items-center justify-between">
- <h2 className="text-md text-mineshaft-100">SCIM</h2>
- <OrgPermissionCan I={OrgPermissionActions.Read} a={OrgPermissionSubjects.Scim}>
- {(isAllowed) => (
- <Button
- onClick={addScimTokenBtnClick}
- colorSchema="secondary"
- isDisabled={!isAllowed}
- >
- Configure
- </Button>
- )}
- </OrgPermissionCan>
- </div>
- <p className="text-sm text-mineshaft-300">Manage SCIM configuration</p>
- </div>
- <ExternalGroupOrgRoleMappings />
- <div className="py-4">
- <div className="mb-2 flex items-center justify-between">
- <h2 className="text-md text-mineshaft-100">Enable SCIM</h2>
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Scim}>
- {(isAllowed) => (
- <Switch
- id="enable-scim"
- onCheckedChange={(value) => {
- if (subscription?.scim) {
- handleEnableSCIMToggle(value);
- } else {
- handlePopUpOpen("upgradePlan", {
- isEnterpriseFeature: true
- });
- }
- }}
- isChecked={currentOrg?.scimEnabled ?? false}
- isDisabled={!isAllowed}
- />
- )}
- </OrgPermissionCan>
- </div>
- <p className="text-sm text-mineshaft-300">
- Allow member provisioning/deprovisioning with SCIM
- </p>
- </div>
+ <>
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <UserCog className="size-4 text-accent" />
+ SCIM Provisioning
+ </CardTitle>
+ <CardDescription>Manage SCIM configuration for member provisioning.</CardDescription>
+ <CardAction>
+ <OrgPermissionCan I={OrgPermissionActions.Read} a={OrgPermissionSubjects.Scim}>
+ {(isAllowed) => (
+ <Button variant="outline" isDisabled={!isAllowed} onClick={addScimTokenBtnClick}>
+ Configure
+ </Button>
+ )}
+ </OrgPermissionCan>
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ <FieldGroup>
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldTitle>Enable SCIM</FieldTitle>
+ <FieldDescription>
+ Allow member provisioning/deprovisioning with SCIM.
+ </FieldDescription>
+ </FieldContent>
+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Scim}>
+ {(isAllowed) => (
+ <Switch
+ id="enable-scim"
+ variant="org"
+ checked={currentOrg?.scimEnabled ?? false}
+ onCheckedChange={handleEnableSCIMToggle}
+ disabled={!isAllowed}
+ />
+ )}
+ </OrgPermissionCan>
+ </Field>
+ </FieldGroup>
+ <Separator className="my-4" />
+ <ExternalGroupOrgRoleMappings />
+ </CardContent>
+ </Card>
<ScimTokenModal
popUp={popUp}
handlePopUpOpen={handlePopUpOpen}
@@ -113,6 +128,6 @@ export const OrgScimSection = () => {
text="Your current plan does not include access to SCIM Provisioning. To unlock this feature, please upgrade to Infisical Enterprise plan."
isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature}
/>
- </div>
+ </>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimEvents.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimEvents.tsx
index e4ac857fea..db16b0d3a2 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimEvents.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimEvents.tsx
@@ -1,20 +1,28 @@
import { Fragment } from "react/jsx-runtime";
-import { faFile, faInfoCircle } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { Info, ScrollText } from "lucide-react";
import {
Button,
- EmptyState,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Empty,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyTitle,
+ Skeleton,
Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- Th,
- THead,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
Tooltip,
- Tr
-} from "@app/components/v2";
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { useOrganization } from "@app/context";
import { formatDateTime } from "@app/helpers/datetime";
import { useGetScimEvents } from "@app/hooks/api/scim/queries";
@@ -38,7 +46,7 @@ export const ScimEvents = () => {
const isEmpty = !isPending && !scimEvents?.pages?.[0].length;
const getEntityDetails = (event: ScimEventData) => {
- if (event.eventType.includes("users")) {
+ if (event.eventType.includes("user")) {
if (event.eventType === ScimEvent.LIST_USERS)
return `Number of users: ${event.event?.numberOfUsers}`;
@@ -54,86 +62,95 @@ export const ScimEvents = () => {
};
return (
- <div className="mt-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
- <div>
- <p className="text-xl font-medium text-gray-200">SCIM Events</p>
- <p className="mt-1 mb-4 text-sm text-gray-400">
- List of all SCIM events that were successfully provisioned from the SCIM server
- </p>
- </div>
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Th className="w-64">Timestamp</Th>
- <Th>Event</Th>
- <Th>Entity</Th>
- </Tr>
- </THead>
- <TBody>
- {!isPending &&
- scimEvents?.pages?.map((group, i) => (
- <Fragment key={`scim-events-fragment-${i + 1}`}>
- {group.map((scimEvent) => (
- <Tr
- key={`scim-events-${scimEvent.id}`}
- className="group h-10 cursor-pointer border-x-0 border-t-0 border-b hover:bg-mineshaft-700"
- role="button"
- tabIndex={0}
- >
- <Td className="align-top">
- {formatDateTime({ timestamp: scimEvent.createdAt })}
- </Td>
- <Td>
- <div className="flex flex-wrap gap-4 text-sm">{scimEvent.eventType}</div>
- </Td>
- <Td>
- <div className="flex flex-wrap gap-4 text-sm">
- {getEntityDetails(scimEvent)}
- <div>
- <Tooltip
- content={
- <div className="my-1 max-h-96 thin-scrollbar overflow-auto rounded-sm border border-mineshaft-600 bg-bunker-800 p-2 font-mono leading-6 whitespace-pre-wrap">
- {JSON.stringify(scimEvent, null, 4)}
- </div>
- }
- className="max-w-xl"
- >
- <FontAwesomeIcon
- icon={faInfoCircle}
- className="opacity-0 transition-all group-hover:opacity-100"
- />
- </Tooltip>
- </div>
- </div>
- </Td>
- </Tr>
+ <Card>
+ <CardHeader>
+ <CardTitle>
+ <ScrollText className="size-4 text-accent" />
+ SCIM Events
+ </CardTitle>
+ <CardDescription>
+ List of all SCIM events that were successfully provisioned from the SCIM server.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ {isEmpty ? (
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>No SCIM events</EmptyTitle>
+ <EmptyDescription>
+ SCIM events provisioned from your SCIM server will appear here.
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ ) : (
+ <>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead className="w-64">Timestamp</TableHead>
+ <TableHead>Event</TableHead>
+ <TableHead>Entity</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {isPending &&
+ Array.from({ length: 5 }).map((_, idx) => (
+ // eslint-disable-next-line react/no-array-index-key
+ <TableRow key={`scim-event-skeleton-${idx}`}>
+ <TableCell colSpan={3}>
+ <Skeleton className="h-5 w-full" />
+ </TableCell>
+ </TableRow>
))}
- </Fragment>
- ))}
- {isPending && <TableSkeleton innerKey="logs-table" columns={3} key="logs-loading" />}
- {isEmpty && (
- <Tr>
- <Td colSpan={3}>
- <EmptyState title="No scim events on file" icon={faFile} />
- </Td>
- </Tr>
- )}
- </TBody>
- </Table>
- </TableContainer>
- {!isEmpty && (
- <Button
- className="mt-4 px-4 py-3 text-sm"
- isFullWidth
- variant="outline_bg"
- isLoading={isFetchingNextPage}
- isDisabled={isFetchingNextPage || !hasNextPage}
- onClick={() => fetchNextPage()}
- >
- {hasNextPage ? "Load More" : "End of logs"}
- </Button>
- )}
- </div>
+ {!isPending &&
+ scimEvents?.pages?.map((group, i) => (
+ <Fragment key={`scim-events-fragment-${i + 1}`}>
+ {group.map((scimEvent) => (
+ <TableRow key={`scim-events-${scimEvent.id}`} className="group">
+ <TableCell>
+ {formatDateTime({ timestamp: scimEvent.createdAt })}
+ </TableCell>
+ <TableCell>
+ <div className="flex flex-wrap gap-4 text-sm">
+ {scimEvent.eventType}
+ </div>
+ </TableCell>
+ <TableCell>
+ <div className="flex flex-wrap items-center gap-2 text-sm">
+ {getEntityDetails(scimEvent)}
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span>
+ <Info className="size-3.5 text-muted opacity-0 transition-all group-hover:opacity-100" />
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xl">
+ <div className="my-1 max-h-96 thin-scrollbar overflow-auto rounded-sm border border-border bg-bunker-800 p-2 font-mono leading-6 whitespace-pre-wrap">
+ {JSON.stringify(scimEvent, null, 4)}
+ </div>
+ </TooltipContent>
+ </Tooltip>
+ </div>
+ </TableCell>
+ </TableRow>
+ ))}
+ </Fragment>
+ ))}
+ </TableBody>
+ </Table>
+ <Button
+ className="mt-4"
+ isFullWidth
+ variant="outline"
+ isPending={isFetchingNextPage}
+ isDisabled={isFetchingNextPage || !hasNextPage}
+ onClick={() => fetchNextPage()}
+ >
+ {hasNextPage ? "Load More" : "End of Logs"}
+ </Button>
+ </>
+ )}
+ </CardContent>
+ </Card>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimTokenModal.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimTokenModal.tsx
index e8f237454a..1f20f1442f 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimTokenModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProvisioningTab/ScimTokenModal.tsx
@@ -1,33 +1,61 @@
-import { useEffect, useState } from "react";
+import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
-import { useTranslation } from "react-i18next";
-import { faCheck, faCopy, faKey, faXmark } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
-import { format } from "date-fns";
+import { ClipboardCheckIcon, Copy, Info, MoreHorizontal, Trash2 } from "lucide-react";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import {
+ Alert,
+ AlertDescription,
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogMedia,
+ AlertDialogTitle,
+ AlertTitle,
Button,
- DeleteActionModal,
- EmptyState,
- FormControl,
+ ButtonGroup,
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DocumentationLinkBadge,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+ Empty,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyTitle,
+ Field,
+ FieldError,
+ FieldGroup,
+ FieldLabel,
IconButton,
Input,
- Modal,
- ModalContent,
+ Skeleton,
Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- Th,
- THead,
- Tr
-} from "@app/components/v2";
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
import { useOrganization } from "@app/context";
-import { useToggle } from "@app/hooks";
+import { formatDateTime } from "@app/helpers/datetime";
+import { useTimedReset } from "@app/hooks";
import { useCreateScimToken, useDeleteScimToken, useGetScimTokens } from "@app/hooks/api";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -54,12 +82,10 @@ type Props = {
export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Props) => {
const { currentOrg } = useOrganization();
- const { t } = useTranslation();
const [token, setToken] = useState("");
-
- const [isScimUrlCopied, setIsScimUrlCopied] = useToggle(false);
- const [isScimTokenCopied, setIsScimTokenCopied] = useToggle(false);
+ const [, isScimUrlCopied, setScimUrlCopied] = useTimedReset<string>({ initialState: "" });
+ const [, isScimTokenCopied, setScimTokenCopied] = useTimedReset<string>({ initialState: "" });
const { data, isPending } = useGetScimTokens(currentOrg?.id ?? "");
const { mutateAsync: createScimTokenMutateAsync } = useCreateScimToken();
@@ -78,19 +104,6 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
}
});
- useEffect(() => {
- let timer: NodeJS.Timeout;
- if (isScimUrlCopied) {
- timer = setTimeout(() => setIsScimUrlCopied.off(), 2000);
- }
-
- if (isScimTokenCopied) {
- timer = setTimeout(() => setIsScimTokenCopied.off(), 2000);
- }
-
- return () => clearTimeout(timer);
- }, [isScimTokenCopied, isScimUrlCopied]);
-
const onFormSubmit = async ({ description, ttlDays }: FormData) => {
if (!currentOrg?.id) return;
@@ -126,184 +139,280 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
const hasToken = Boolean(token);
const scimUrl = `${window.origin}/api/v1/scim`;
+ const hasTokens = !isPending && Boolean(data && data.length > 0);
return (
- <Modal
- isOpen={popUp?.scimToken?.isOpen}
- onOpenChange={(isOpen) => {
- handlePopUpToggle("scimToken", isOpen);
- reset();
- setToken("");
- }}
- >
- <ModalContent title="Manage SCIM credentials">
- <h2 className="mb-4">SCIM URL</h2>
- <div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">
- <p className="mr-4 break-all">{scimUrl}</p>
- <IconButton
- ariaLabel="copy icon"
- colorSchema="secondary"
- className="group relative"
- onClick={() => {
- navigator.clipboard.writeText(scimUrl);
- setIsScimUrlCopied.on();
- }}
- >
- <FontAwesomeIcon icon={isScimUrlCopied ? faCheck : faCopy} />
- <span className="group-hover:animate-fade-in absolute -top-20 -left-8 hidden w-28 translate-y-full rounded-md bg-bunker-800 py-2 pl-3 text-center text-sm text-gray-400 group-hover:flex">
- {t("common.click-to-copy")}
- </span>
- </IconButton>
- </div>
- <h2 className="mb-4">New SCIM Token</h2>
- {hasToken ? (
- <div>
- <div className="mb-4 flex items-center justify-between">
- <p>We will only show this token once</p>
- <Button
- colorSchema="secondary"
- type="submit"
- onClick={() => {
- reset();
- setToken("");
- }}
- >
- Got it
- </Button>
- </div>
- <div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">
- <p className="mr-4 break-all">{token}</p>
- <IconButton
- ariaLabel="copy icon"
- colorSchema="secondary"
- className="group relative"
- onClick={() => {
- navigator.clipboard.writeText(token);
- setIsScimTokenCopied.on();
- }}
- >
- <FontAwesomeIcon icon={isScimTokenCopied ? faCheck : faCopy} />
- <span className="group-hover:animate-fade-in absolute -top-20 -left-8 hidden w-28 translate-y-full rounded-md bg-bunker-800 py-2 pl-3 text-center text-sm text-gray-400 group-hover:flex">
- {t("common.click-to-copy")}
- </span>
- </IconButton>
- </div>
- </div>
- ) : (
- <form onSubmit={handleSubmit(onFormSubmit)} className="mb-8">
- <Controller
- control={control}
- defaultValue=""
- name="description"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Description (optional)"
- isError={Boolean(error)}
- errorText={error?.message}
- >
- <Input {...field} placeholder="Description" />
- </FormControl>
- )}
- />
- <Controller
- control={control}
- defaultValue="365"
- name="ttlDays"
- render={({ field, fieldState: { error } }) => (
- <FormControl label="TTL (days)" isError={Boolean(error)} errorText={error?.message}>
- <div className="flex">
- <Input {...field} placeholder="0" type="number" min="0" step="1" />
- <Button
- className="ml-4"
- size="sm"
- type="submit"
- isLoading={isSubmitting}
- isDisabled={isSubmitting}
- >
- Create
- </Button>
- </div>
- </FormControl>
- )}
- />
- </form>
- )}
- <h2 className="mb-4">SCIM Tokens</h2>
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Th>Description</Th>
- <Th>Expires At</Th>
- <Th>Created At</Th>
- <Th className="w-5" />
- </Tr>
- </THead>
- <TBody>
- {isPending && <TableSkeleton columns={4} innerKey="org-scim-tokens" />}
- {!isPending &&
- data &&
- data.length > 0 &&
- data.map(({ id, description, ttlDays, createdAt }) => {
- const isInvalidTTLDays = ttlDays > 9999; // added validation later so some users would still be using this
- let expiresAt;
- if (ttlDays > 0) {
- expiresAt = isInvalidTTLDays
- ? new Date()
- : new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
- }
-
- return (
- <Tr className="h-10 items-center" key={`mi-client-secret-${id}`}>
- <Td>{description === "" ? "-" : description}</Td>
- <Td>
- {expiresAt && !isInvalidTTLDays
- ? format(expiresAt, "yyyy-MM-dd HH:mm:ss")
- : "-"}
- </Td>
- <Td>{format(new Date(createdAt), "yyyy-MM-dd HH:mm:ss")}</Td>
- <Td>
+ <>
+ <Dialog
+ open={popUp?.scimToken?.isOpen}
+ onOpenChange={(isOpen) => {
+ handlePopUpToggle("scimToken", isOpen);
+ reset();
+ setToken("");
+ }}
+ >
+ <DialogContent className="max-w-3xl">
+ <DialogHeader>
+ <DialogTitle className="flex items-center gap-x-2">
+ Manage SCIM Credentials
+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/scim/overview" />
+ </DialogTitle>
+ <DialogDescription>
+ Generate and manage the tokens your SCIM provider uses to authenticate.
+ </DialogDescription>
+ </DialogHeader>
+ <form onSubmit={handleSubmit(onFormSubmit)} className="flex flex-col gap-4">
+ <div className="flex flex-col gap-6">
+ <FieldGroup>
+ <Field>
+ <FieldLabel>SCIM URL</FieldLabel>
+ <ButtonGroup className="w-full">
+ <Input value={scimUrl} readOnly aria-label="SCIM URL" className="font-mono" />
+ <Tooltip>
+ <TooltipTrigger asChild>
<IconButton
+ variant="outline"
+ aria-label="Copy SCIM URL"
onClick={() => {
- handlePopUpOpen("deleteScimToken", {
- scimTokenId: id
- });
+ navigator.clipboard.writeText(scimUrl);
+ setScimUrlCopied("copied");
}}
- size="lg"
- colorSchema="primary"
- variant="plain"
- ariaLabel="update"
>
- <FontAwesomeIcon icon={faXmark} />
+ {isScimUrlCopied ? <ClipboardCheckIcon /> : <Copy />}
</IconButton>
- </Td>
- </Tr>
- );
- })}
- {!isPending && data && data?.length === 0 && (
- <Tr>
- <Td colSpan={4}>
- <EmptyState title="No SCIM tokens have been created yet" icon={faKey} />
- </Td>
- </Tr>
+ </TooltipTrigger>
+ <TooltipContent>{isScimUrlCopied ? "Copied" : "Copy"}</TooltipContent>
+ </Tooltip>
+ </ButtonGroup>
+ </Field>
+ {hasToken ? (
+ <>
+ <Field>
+ <FieldLabel>New SCIM Token</FieldLabel>
+ <ButtonGroup className="w-full">
+ <Input
+ value={token}
+ readOnly
+ aria-label="SCIM token"
+ className="font-mono"
+ />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <IconButton
+ variant="outline"
+ aria-label="Copy SCIM token"
+ onClick={() => {
+ navigator.clipboard.writeText(token);
+ setScimTokenCopied("copied");
+ }}
+ >
+ {isScimTokenCopied ? <ClipboardCheckIcon /> : <Copy />}
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent>{isScimTokenCopied ? "Copied" : "Copy"}</TooltipContent>
+ </Tooltip>
+ </ButtonGroup>
+ </Field>
+ <Alert variant="info">
+ <Info />
+ <AlertTitle>Copy this token now</AlertTitle>
+ <AlertDescription>You won&apos;t be able to see it again.</AlertDescription>
+ </Alert>
+ </>
+ ) : (
+ <>
+ <Controller
+ control={control}
+ name="description"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel htmlFor="scim-token-description">
+ Description (Optional)
+ </FieldLabel>
+ <Input
+ id="scim-token-description"
+ placeholder="Description"
+ isError={Boolean(error)}
+ {...field}
+ />
+ <FieldError>{error?.message}</FieldError>
+ </Field>
+ )}
+ />
+ <Controller
+ control={control}
+ name="ttlDays"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel htmlFor="scim-token-ttl">TTL (Days)</FieldLabel>
+ <Input
+ id="scim-token-ttl"
+ placeholder="0"
+ type="number"
+ min="0"
+ step="1"
+ isError={Boolean(error)}
+ {...field}
+ />
+ <FieldError>{error?.message}</FieldError>
+ </Field>
+ )}
+ />
+ </>
+ )}
+ </FieldGroup>
+ {!hasToken && (
+ <div>
+ <div className="mb-2 text-sm font-medium text-foreground">SCIM Tokens</div>
+ {isPending || hasTokens ? (
+ <Table containerClassName="max-h-[40vh] overflow-y-auto overflow-x-hidden">
+ <TableHeader className="sticky top-0 z-[1] [&_th]:bg-container">
+ <TableRow>
+ <TableHead className="w-full" isTruncatable>
+ Description
+ </TableHead>
+ <TableHead>Expires At</TableHead>
+ <TableHead>Created At</TableHead>
+ <TableHead className="w-px text-right" aria-label="Actions" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {isPending &&
+ Array.from({ length: 3 }).map((_, idx) => (
+ // eslint-disable-next-line react/no-array-index-key
+ <TableRow key={`scim-token-skeleton-${idx}`}>
+ <TableCell colSpan={4}>
+ <Skeleton className="h-5 w-full" />
+ </TableCell>
+ </TableRow>
+ ))}
+ {!isPending &&
+ data?.map(({ id, description, ttlDays, createdAt }) => {
+ const isInvalidTTLDays = ttlDays > 9999; // added validation later so some users would still be using this
+ let expiresAt;
+ if (ttlDays > 0) {
+ expiresAt = isInvalidTTLDays
+ ? new Date()
+ : new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
+ }
+
+ return (
+ <TableRow key={`scim-token-${id}`}>
+ <TableCell isTruncatable className="font-medium text-foreground">
+ {description === "" ? (
+ <span className="text-muted">—</span>
+ ) : (
+ description
+ )}
+ </TableCell>
+ <TableCell>
+ {expiresAt && !isInvalidTTLDays ? (
+ formatDateTime({ timestamp: expiresAt })
+ ) : (
+ <span className="text-muted">—</span>
+ )}
+ </TableCell>
+ <TableCell>{formatDateTime({ timestamp: createdAt })}</TableCell>
+ <TableCell className="text-right">
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton
+ variant="ghost"
+ size="xs"
+ aria-label={`Actions for SCIM token ${description || id}`}
+ >
+ <MoreHorizontal />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-40">
+ <DropdownMenuItem
+ variant="danger"
+ onClick={() => {
+ handlePopUpOpen("deleteScimToken", {
+ scimTokenId: id
+ });
+ }}
+ >
+ <Trash2 />
+ Delete
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </TableCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ ) : (
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>No SCIM tokens</EmptyTitle>
+ <EmptyDescription>
+ Create a token above to authenticate your SCIM provider.
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ )}
+ </div>
)}
- </TBody>
- </Table>
- </TableContainer>
- <DeleteActionModal
- isOpen={popUp.deleteScimToken.isOpen}
- title="Are you sure you want to delete the SCIM token?"
- onChange={(isOpen) => handlePopUpToggle("scimToken", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() => {
- const deleteScimTokenData = popUp?.deleteScimToken?.data as {
- scimTokenId: string;
- };
+ </div>
+ <DialogFooter>
+ {hasToken ? (
+ <DialogClose asChild>
+ <Button type="button" variant="org">
+ Got It
+ </Button>
+ </DialogClose>
+ ) : (
+ <>
+ <DialogClose asChild>
+ <Button type="button" variant="ghost">
+ Close
+ </Button>
+ </DialogClose>
+ <Button type="submit" variant="org" isPending={isSubmitting}>
+ Create Token
+ </Button>
+ </>
+ )}
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+
+ <AlertDialog
+ open={popUp.deleteScimToken.isOpen}
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteScimToken", isOpen)}
+ >
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogMedia>
+ <Trash2 />
+ </AlertDialogMedia>
+ <AlertDialogTitle>Delete SCIM Token?</AlertDialogTitle>
+ <AlertDialogDescription>
+ Any SCIM provider using this token will no longer be able to authenticate. This cannot
+ be undone.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogAction
+ variant="danger"
+ onClick={() => {
+ const deleteScimTokenData = popUp?.deleteScimToken?.data as {
+ scimTokenId: string;
+ };
- return onDeleteScimTokenSubmit(deleteScimTokenData.scimTokenId);
- }}
- />
- </ModalContent>
- </Modal>
+ return onDeleteScimTokenSubmit(deleteScimTokenData.scimTokenId);
+ }}
+ >
+ Delete
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </>
);
};