Retrieve All Roles From a User Using Auth0 Actions Including Roles From Enterprise Groups
Last Updated:
Overview
In an Auth0 Action, event.authorization.roles returns only directly assigned roles, omitting roles assigned through System for Cross-domain Identity Management (SCIM) groups or Enterprise Groups. Retrieve all effective roles by using the api.roles.getUserEffectiveRoles method.
Applies To
- Auth0
- Actions
- Roles
- System for Cross-domain Identity Management (SCIM) Groups
- Enterprise Groups
Solution
How does Auth0 retrieve effective roles in an Action?
Retrieve all effective roles for a user, including those from SCIM or Enterprise Groups, by using the api.roles.getUserEffectiveRoles method in a Post-Login Action.
- Call the
api.roles.getUserEffectiveRolesmethod within the Action script instead of relying onevent.authorization.roles. - Review the Auth0 Management API documentation for details on the endpoint.
- Review the Post-Login API Object documentation for implementation parameters.