Skip to content

Role Mapping

Role mapping assigns workspace roles to employees based on attributes returned by the identity provider (IdP). SAML can read attributes from assertions, and OIDC can read user information obtained during login. Each workspace configures and enables mapping separately for its own IdP.

Login Results After Enabling

Whether Role Mapping Is Enabled for the IdP Result After an Employee Logs In
Disabled Accounts that already have roles in the workspace retain their roles. Accounts that have not been assigned a role receive the default role configured for that IdP in the User SSO list.
Enabled, one rule matched The account receives the role specified by that rule.
Enabled, multiple rules matched The account receives the roles specified by all matched rules. Duplicate roles are assigned only once.
Enabled, no rule matched The account cannot access the current workspace through this IdP. The account's existing role in that workspace is cleared during login validation.

Add and Enable a Mapping

  1. In the target workspace, go to Management > Member Management > SSO Management > Role Mapping and click Add Mapping.
  2. Select a configured SAML or OIDC identity provider.
  3. Enter the Attribute Field and Attribute Value returned by the identity provider. Enter the attribute value exactly as returned, including case. For example, if the user group field returns ["qa", "ops"], a rule that specifies ops can match.
  4. Select the role to grant when the rule matches, and save. To match multiple different attribute values, add a separate rule for each value.
  5. Return to the User SSO list and set Role Mapping to enabled for the corresponding identity provider.
  6. Log in again with a test account, and verify that the user can access the target workspace and what roles they receive. After testing both the matched and unmatched cases, use this configuration for employees.

Configuration Example

Assume the identity provider returns the following attributes.

{
  "department": "技术部",
  "groups": ["qa", "ops"]
}
Attribute Field Attribute Value Role
department 技术部 Standard Member
groups ops Ops Custom Role

The employee matches both rules and receives the Standard Member and Ops Custom Role after logging in. When configuring, use the fields and attribute values returned by the IdP.

Manage Mapping Rules

Search and Filter

  • Search: Supports keyword search by role, attribute field, or attribute value.
  • Filter: Filter by identity provider to quickly locate rules for a specific IdP.

Edit a Rule

Click Edit to the right of the rule to modify the attribute field, attribute value, or role. After a rule is modified, logged-in users are revalidated the next time they log in. If a user no longer matches any rule after the modification, all their roles are revoked and they cannot log in.

Delete a Rule

You can delete individual rules or multiple rules in batches.

After a rule is deleted, users who previously matched that rule will not match a role the next time they log in; all their roles will be revoked, and they cannot log in. Before deleting, confirm the scope of affected users or configure replacement rules first.

Related Documentation

SSO Management · SAML Configuration · OIDC Configuration · Login Troubleshooting

Feedback

Is this page helpful?