|
1 | 1 | # User Provisioning (SCIM) |
2 | 2 |
|
3 | 3 | > [!WARNING] |
4 | | -> This feature is part of the <a href="https://huggingface.co/contact/sales?from=enterprise" target="_blank">Enterprise Plus</a> plan. |
| 4 | +> This feature is part of the <a href="https://huggingface.co/enterprise">Enterprise</a> and <a href="https://huggingface.co/contact/sales?from=enterprise" target="_blank">Enterprise Plus</a> plans. |
5 | 5 |
|
6 | | -SCIM, or System for Cross-domain Identity Management, is a standard for automating user provisioning. It allows you to connect your Identity Provider (IdP) to Hugging Face to automatically manage your organization's members. |
| 6 | +SCIM (System for Cross-domain Identity Management) is a standard for automating user provisioning. It allows you to connect your Identity Provider (IdP) to Hugging Face to manage your organization's members. |
7 | 7 |
|
8 | | -With SCIM, you can: |
9 | | -- **Provision users**: Automatically create user accounts in your Hugging Face organization when they are assigned the application in your IdP. |
10 | | -- **Update user attributes**: Changes made to user profiles in your IdP (like name or email) are automatically synced to Hugging Face. |
11 | | -- **Provision groups**: Create groups in your Hugging Face organization based on groups in your IdP. |
12 | | -- **Deprovision users**: Automatically deactivate user accounts in your Hugging Face organization when they are unassigned from the application or deactivated in your IdP. |
| 8 | +SCIM works differently depending on your SSO model. For a detailed comparison, see the [SSO overview](./enterprise-sso#user-provisioning-scim). |
13 | 9 |
|
14 | | -This ensures that your Hugging Face organization's member list is always in sync with your IdP, streamlining user lifecycle management and improving security. |
| 10 | +## Basic SSO: invitation-based provisioning |
| 11 | + |
| 12 | +With [Basic SSO](./security-sso-basic) (Enterprise plan), SCIM automates the **invitation** of existing Hugging Face users to your organization. |
| 13 | + |
| 14 | +- Users **must already have a Hugging Face account** before they can be provisioned via SCIM |
| 15 | +- When your IdP provisions a user, Hugging Face sends them an **invitation email** to join the organization |
| 16 | +- The user must **accept the invitation** to become a member — provisioning does not grant immediate access |
| 17 | +- SCIM **cannot modify** user profile information (name, email, username) — the user retains full control of their Hugging Face account |
| 18 | +- When a user is deprovisioned in your IdP, their invitation is deactivated and their access to the organization is revoked |
| 19 | + |
| 20 | +## Managed SSO: full lifecycle provisioning |
| 21 | + |
| 22 | +With [Managed SSO](./enterprise-advanced-sso) (Enterprise Plus plan), SCIM manages the **entire user lifecycle** on Hugging Face. |
| 23 | + |
| 24 | +- SCIM **creates a new Hugging Face account** when a user is provisioned — no pre-existing account is needed |
| 25 | +- The user is **immediately added** to the organization as a member, with no invitation step |
| 26 | +- SCIM **can update** user profile information (name, email, username) as changes occur in your IdP |
| 27 | +- When a user is deprovisioned in your IdP, their Hugging Face account is deactivated and their access is revoked |
15 | 28 |
|
16 | 29 | ## How to enable SCIM |
17 | 30 |
|
18 | 31 | To enable SCIM, go to your organization's settings, navigate to the **SSO** tab, and then select the **SCIM** sub-tab. |
19 | 32 |
|
20 | | -You will find the **SCIM Tenant URL** and a button to generate an **access token**. You will need both of these to configure your IdP. The SCIM token is a secret and should be stored securely in your IdP's configuration. |
| 33 | +You will find the **SCIM Tenant URL** and a button to generate a **SCIM token**. You will need both of these to configure your IdP. The SCIM token is a secret and should be stored securely in your IdP's configuration. |
21 | 34 |
|
22 | 35 | <div class="flex justify-center"> |
23 | 36 | <img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/sso/scim-settings.png"/> |
24 | 37 | <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/sso/scim-settings-dark.png"/> |
25 | 38 | </div> |
26 | 39 |
|
27 | | -Once SCIM is enabled in your IdP, users and groups provisioned will appear in the "Users Management" and "SCIM" tabs respectively. |
| 40 | +Once SCIM is enabled in your IdP, provisioned users will appear in the **Users Management** tab and provisioned groups will appear in the **SCIM** tab in your organization's settings. |
| 41 | + |
| 42 | +## Group provisioning |
| 43 | + |
| 44 | +In addition to user provisioning, SCIM supports **group provisioning**. Groups pushed from your IdP are stored as SCIM groups on Hugging Face and can be linked to [Resource Groups](./enterprise-resource-groups) from the **SCIM** tab in your organization's settings. |
| 45 | + |
| 46 | +When a SCIM group is linked to a Resource Group, membership changes are **automatically synchronized**: |
| 47 | + |
| 48 | +- When a user is **added** to a group in your IdP, they are automatically added to the linked Resource Groups with the configured role. |
| 49 | +- When a user is **removed** from a group in your IdP, they are automatically removed from the linked Resource Groups. |
| 50 | +- When a SCIM group is **deleted** in your IdP, all of its members are removed from the linked Resource Groups. |
| 51 | + |
| 52 | +This allows you to manage Resource Group membership entirely from your Identity Provider, without manual configuration on Hugging Face. |
| 53 | + |
| 54 | +Group provisioning works the same way for both Basic SSO and Managed SSO. |
| 55 | + |
| 56 | +## Supported user attributes |
| 57 | + |
| 58 | +The Hugging Face SCIM endpoint supports the following user attributes: |
| 59 | + |
| 60 | +| Attribute | Description | Basic SSO | Managed SSO | |
| 61 | +| --- | --- | --- | --- | |
| 62 | +| `userName` | Hugging Face username | Read-only | Read/Write | |
| 63 | +| `name.givenName` | First name | Read-only | Read/Write | |
| 64 | +| `name.familyName` | Last name | Read-only | Read/Write | |
| 65 | +| `emails[type eq "work"].value` | Email address | Read-only | Read/Write | |
| 66 | +| `externalId` | IdP-assigned identifier | Read/Write | Read/Write | |
| 67 | +| `active` | Whether the user is an active member | Read/Write | Read/Write | |
| 68 | + |
| 69 | +With Basic SSO, only `active` and `externalId` can be modified via SCIM — all other attributes are controlled by the user on their Hugging Face account. |
| 70 | + |
| 71 | +For group provisioning, the supported attributes are `displayName`, `members`, and `externalId`. |
| 72 | + |
| 73 | +## Deprovisioning |
| 74 | + |
| 75 | +Deprovisioning behavior depends on how the user is removed and which SSO model you use. |
| 76 | + |
| 77 | +**Setting `active` to `false`** (soft deprovision): |
| 78 | + |
| 79 | +- The user loses access to the organization |
| 80 | +- With Basic SSO: the invitation is deactivated |
| 81 | +- With Managed SSO: the user is removed from the organization but their account and content are preserved — this is **reversible** by setting `active` back to `true` |
| 82 | + |
| 83 | +**Deleting the user via SCIM** (hard deprovision): |
| 84 | + |
| 85 | +- With Basic SSO: the user is removed from the organization and all its resource groups. Their Hugging Face account and personal content are **not affected** — they simply lose membership in your organization. |
| 86 | +- With Managed SSO: the user's Hugging Face account is **permanently deleted**, along with all content they created. This action is **irreversible**. |
28 | 87 |
|
29 | 88 | ## Supported Identity Providers |
30 | 89 |
|
|
0 commit comments