Shy
03/25/2026, 3:05 AMDevRev
03/25/2026, 3:05 AM{
"groups": "{{user.customAttributes.groups}}",
"tenant_groups": "{{tenant.groups}}"
}
Alternative: Custom Claims Action
For flow-specific group inclusion, add a Custom Claims action to your authentication flow:
1. Add Custom Claims action to your sign-in flow
2. Set key as groups with dynamic value user.customAttributes.groups
3. This updates the JWT each time the user authenticates
Group Data Synchronization
SCIM groups from Okta are automatically mapped to Descope roles by default . To access raw group data instead of mapped roles, you'll need to:
• Configure your SCIM mapping to store groups as custom attributes rather than roles
• Use the Management API /v1/mgmt/group/member/all to fetch current group memberships
• Update user custom attributes with group data via API when groups change
The JWT template approach ensures group data is included in every token issuance and automatically reflects updates when users re-authenticate .
SCIM Management | Descope Documentation
Permissions Management API | Descope Documentation
JWT Templates | Descope DocumentationShy
03/25/2026, 3:28 AMDevRev
03/25/2026, 3:28 AM{
"groups": "{{roles}}"
}
This will include the current user's roles (which are your SCIM groups) in the JWT.
Alternative: Management API Approach
If you need the raw group names instead of mapped roles:
1. Use the Management API /v1/mgmt/group/member/all to fetch group data
2. Store group information as custom user attributes
3. Reference those custom attributes in your JWT template or Custom Claims action
Check Available Variables
In the JWT template editor, you should see available variables when typing {{ - this will show you the actual variables you can use for your specific setup.
The documentation doesn't cover all available JWT template variables comprehensively. I'd recommend testing with the built-in variable suggestions in the Descope Console to find the correct syntax for accessing group data in your environment.Shy
03/25/2026, 3:31 AM{
"groups": "{{roles}}"
}
wont work, since groups are not matched into roles if those roles doest exsitsDevRev
03/25/2026, 3:31 AMroles claim.
Solution: Use Management API + Custom Attributes
Since the groups exist in the API but not as roles, you need to:
1. Fetch group data via Management API and store as custom user attributes:
// Use /v1/mgmt/group/member/all to get user's groups
// Store result in user custom attributes via Management API
2. Reference custom attributes in JWT template:
{
"groups": "{{user.customAttributes.scim_groups}}"
}
Alternative: Webhook Approach
Set up a webhook that triggers on SCIM group changes to automatically update user custom attributes with current group memberships.
Check Custom Attribute Variables
In your JWT template editor, try typing {{user. to see available custom attribute variables. The exact syntax depends on how you name the custom attribute that stores your group data.
The key is storing the group information from the Management API response into user custom attributes, then referencing those attributes in your JWT template.Shy
03/25/2026, 3:38 AMDevRev
03/25/2026, 3:38 AMAvi Glozman
03/25/2026, 5:43 AMShy
03/25/2026, 6:55 AMShy
03/25/2026, 6:59 AMPush Groups tab and select groups to be provisioned, by group name or dynamic rule.)Doron Sharon
03/25/2026, 7:23 AMDoron Sharon
03/25/2026, 7:24 AMShy
03/25/2026, 8:03 AMDoron Sharon
03/25/2026, 8:13 AMDoron Sharon
03/25/2026, 8:13 AMDoron Sharon
03/25/2026, 8:14 AMDoron Sharon
03/25/2026, 8:14 AMDoron Sharon
03/25/2026, 8:24 AM