api.accessToken.setCustomClaim Does Not Set the Custom Email Claim

Overview

This article explains why an action that calls the following API will successfully set the custom "email" claim for some applications but fail to set it for others.

api.accessToken.setCustomClaim("email", "some@email.com")

 

 

Applies To

  • Application with Resource Owner Password Grant (ROPG)
  • Access Token
  • Custom Claims

Cause

The "email" custom claim is configurable only when using an interactive flow that redirects the user to the Auth0 Universal Login for credentials.

When the application uses the password grant, general restrictions apply to "email" as a custom claim. For more details, refer to the documentation on non-restricted claims.

Solution

As a workaround, we suggest using a namespaced custom claim and refactoring the application to parse the namespaced claim. 

Related References

Recommended content

No recommended content found...