Skip to content

Commit 2bbf8ba

Browse files
committed
update sso role mapping doc
1 parent b1bda18 commit 2bbf8ba

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

docs/hub/security-sso.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,28 @@ The default value is 7 days.
5858

5959
When enabled, Role Mapping allows you to dynamically assign [roles](./organizations-security#access-control-in-organizations) to organization members based on data provided by your Identity Provider.
6060

61-
This section allows you to define a mapping from your IdP's user profile data from your IdP to the assigned role in Hugging Face.
61+
This section allows you to define a mapping from your IdP's user profile data to the assigned role in Hugging Face.
6262

63-
- IdP Role Attribute Mapping
63+
- **IdP Role Attribute Path**
6464

6565
A JSON path to an attribute in your user's IdP profile data.
66+
It supports dot notation (e.g. `user.role` or `groups`).
67+
For SAML, this can be a URI if your claims are URIs (e.g. `http://schemas.microsoft.com/ws/2008/06/identity/claims/role`).
6668

67-
- Role Mapping
69+
- **Role Mapping**
6870

6971
A mapping from the IdP attribute value to the assigned role in the Hugging Face organization.
72+
73+
Available roles are `admin`, `write`, `contributor`, and `read`. See [roles documentation](./organizations-security#access-control-in-organizations) for more details.
7074

71-
You must map at least one admin role.
75+
> [!IMPORTANT]
76+
> You must map at least one `admin` role in your configuration.
77+
78+
If the attribute in the IdP response contains multiple values (e.g. a list of groups), the **first matching mapping** will be used to determine the user's role.
7279

7380
If there is no match, a user will be assigned the default role for your organization. The default role can be customized in the `Members` section of the organization's settings.
7481

75-
Role synchronization is performed on login.
82+
Role synchronization is performed on every login.
7683

7784
#### Resource Group Mapping
7885

@@ -83,13 +90,15 @@ When enabled, Resource Group Mapping allows you to dynamically assign members to
8390
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/enterprise/resource-group-mapping-dark.png"/>
8491
</div>
8592

86-
- IdP Attribute Path
93+
- **IdP Attribute Path**
8794

88-
A JSON path to an attribute in your user's IdP profile data.
95+
A JSON path to an attribute in your user's IdP profile data. Similar to Role Mapping, this supports dot notation or URIs for SAML.
96+
97+
- **Resource Group Mapping**
8998

90-
- Resource Group Mapping
99+
A mapping from the IdP attribute value to a resource group in your Hugging Face organization. You can assign a specific role (`admin`, `write`, `contributor`, `read`) for each resource group mapping.
91100

92-
A mapping from the IdP attribute value to a resource group in your Hugging Face organization.
101+
Unlike Role Mapping, **Resource Group Mapping is additive**. If a user matches multiple mappings (e.g. they belong to multiple groups in your IdP that are mapped to different Resource Groups), they will be added to **all** matched Resource Groups.
93102

94103
If there is no match, the user will not be assigned to any resource group.
95104

0 commit comments

Comments
 (0)