How to Set Up SSO Group-to-Role Mappings
Automatically assign Chainsaw roles based on IdP group claims, so users get the right permissions on every SSO login.
Overview
By default, all SSO users receive a single default role (typically Member). Group-to-role mappings let you automatically assign Chainsaw roles based on the groups your identity provider includes in the SSO token. This means:
- Users in your IdP’s “Supply-Chain-Admins” group automatically become Chainsaw Admins
- Users in “Dev-Team” automatically become Managers
- Role changes happen on every login, keeping permissions in sync with your IdP
This works with both OIDC and SAML SSO.
Prerequisites
- SSO already configured (OIDC or SAML)
- Owner or Admin role in Chainsaw
- Your IdP configured to include group claims in tokens/assertions
Step 1: Configure Your IdP to Send Group Claims
Your identity provider must include a groups claim in the SSO token. The setup varies by provider:
Okta
- Navigate to your Chainsaw application in Okta
- Go to Sign On > OpenID Connect ID Token
- Add a Groups claim: Name =
groups, Filter = matches regex.*
Azure AD (Entra ID)
- Navigate to App Registrations > your Chainsaw app
- Go to Token configuration > Add groups claim
- Select Security groups and/or Groups assigned to the application
- For SAML: the claim appears as
http://schemas.microsoft.com/ws/2008/06/identity/claims/groups
Google Workspace
Google Workspace does not natively support group claims in OIDC tokens. Use SCIM provisioning instead.
custom:groups or roles), you can configure the claim name in Chainsaw’s SSO settings.Step 2: Set the Group Claim Name in Chainsaw
Navigate to Settings > SSO and find the Group Claim Name field (in the Group-to-Role Mappings section):
- For most IdPs:
groups(the default) - For Azure AD with OIDC:
groups - For custom claims: enter the exact claim name your IdP uses
Click Save Configuration to update.
Step 3: Create Group-to-Role Mappings
In the Group-to-Role Mappings section on the SSO settings page:
- Enter the IdP Group Value – the exact group name or ID that appears in the token
- Select the Chainsaw Role – any built-in role or custom role
- Set the Priority – higher numbers are evaluated first (use this when a user belongs to multiple groups)
- Click the + button to add the mapping
Example Mappings
| IdP Group Value | Chainsaw Role | Priority |
|---|---|---|
supply-chain-admins | org-admin | 100 |
security-team | org-manager | 50 |
developers | org-member | 10 |
Step 4: Test the Mapping
- Log in via SSO with a test user who belongs to one of the mapped groups
- Navigate to Settings > Users and verify the user was assigned the correct role
- Log in with a user in a different group and verify they get a different role
- Log in with a user in no mapped groups and verify they get the default role
How It Works
On every SSO login (both OIDC and SAML), Chainsaw:
- Extracts the groups from the token/assertion using the configured claim name
- Compares them against the group-to-role mappings (highest priority first)
- Assigns the first matching role
- If no mapping matches, uses the SSO provider’s default role
- Updates the user’s membership role if it changed
This means role changes are reflected on next login – no manual intervention needed.
Best Practices
- Use descriptive group names in your IdP (e.g.
chainsaw-adminsrather than a UUID) - Map to the minimum role needed – follow the principle of least privilege
- Set priorities carefully – a user in both “admins” and “developers” should get the admin role (higher priority)
- Include a catch-all mapping if you want all SSO users to get at least Member access
- Test with edge cases – users in multiple groups, users in no groups, new JIT-provisioned users
- Use custom roles for fine-grained access – you can map IdP groups to custom roles with specific permission sets
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| User gets default role despite being in a group | Group claim not in token | Verify IdP sends groups; check claim name matches |
| Wrong role assigned | Priority ordering | Higher priority mappings are checked first; adjust priorities |
| Mapping not applied on existing users | User already had a role | Mappings are re-evaluated on every login; have the user log in again |
| Azure AD sends GUIDs instead of names | Default Azure behavior | In Azure AD Token Configuration, switch to emit group names or use the GUID in your mapping |
Next Steps
- How to Configure SSO/OIDC – Set up the SSO connection first
- How to Configure SAML 2.0 SSO – Use SAML with group claims
- How to Configure SCIM Provisioning – Automate user provisioning alongside role mapping
- How to Invite Team Members and Assign Roles – Manual role management