Auth0 Groups not Accessible in Actions

Overview

The following Rule is used to add an IdToken property ("user.groups") from a SAML claim.

function (user, context, callback)
{
context.idToken['user.groups'] = user.groups;
callback(null, user, context);
}


When attempting to implement this in an Action, is unclear how to retrieve the SAML claim for groups in order to populate the custom claim in the IdToken. This may be something in use so far:

exports.onExecutePostLogin = async (event, api) => {
api.idToken.setCustomClaim("user.groups", <???>);
}


The claim is not in user_metadata or app_metadata. This article explains whether this is supporting using Actions. 

Applies To

  • Actions
  • Auth0 Groups

Solution

At the moment, user groups cannot be referenced in Auth0 Actions—only Rules. This is being worked on for the upcoming parity backlog for rules deprecation.

Recommended content

No recommended content found...