I have integrated auth0 OIDC service with 3 applications.
It was required that I use nickname as the preffered_username in those applications.
As per requirements I have added the custom claim, but I see errors in my application stating that claim nickname not found. Since I cannot use postman to fetch access_token, what should be my proper flow to check the access token claims.
If auth0 claim is perfect, then it might be my application that is fault, but I am unable to confirm whether auth0 is sending the claim in JWT.
Are you able to get a hold of an example access token in one of your applications? You can decode it at jwt.io.
How are you adding the custom claim? If you’d like to share any extensibility code (Action, Rule, etc.) here I’d be happy to take a look.
Auth0 provides sample apps for all supported technologies so it may be worth configuring one to test with if you are unable to in your own applications.
Thanks for getting back to me, and the rule code definitely helps!
I can confirm that the rule works as expected - I just tested this in my own environment.
You should be able to use the Resource Owner Password Flow to get an access token as long as that grant is enabled for your application. For example, I used a SPA app with the password grant type enabled (Application → Advanced Settings → Grant Types) and a curl request like the following:
This should return an access token you can inspect at jwt.io - Like I said, your rule works as expected. Assuming you’ve switched that on in your tenant settings then my guess is this is breaking down elsewhere.