Auth0 Home Blog Docs

Not getting custom claims back in idToken from Rule

rules

#1

Simple mobile app in flutter so using the basic web authentication no Lock sdks. Have a rule below to return simple Test Claim. Right now have scope set to openid profile. Not getting my test Claim back any ideas?

function (user, context, callback) {

if (context.clientID === ‘XXXXXXXXXXXXXXXXXXXXXXX’) {
context.idToken[‘https://XXXXXXXXXXXXX.auth0.com/test’] = “Dude”;

}
callback(null, user, context);
}


#2

For more information this is a user authenticating with a Auth0 app checking the ClintId of the application in context.

Using the PKCE Flow after calling the oauth/token endpoint I get back idToken but no custom claims are in the token body.