Retrieve All Roles From a User Using Auth0 Actions Including Roles From Enterprise Groups

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.

  1. Call the api.roles.getUserEffectiveRoles method within the Action script instead of relying on event.authorization.roles.
  2. Review the Auth0 Management API documentation for details on the endpoint.
  3. Review the Post-Login API Object documentation for implementation parameters.

Recommended content

No recommended content found...