How do I get a JWT for an authenticated user which has gone through the Post Login Action (for setting custom claims)?

Hi @aaandrew,

Welcome to the Auth0 Community!

To get a JWT access token for a user who has authenticated and triggered the Post-Login Action, please follow our Call Your API Using the Authorization Code Flow documentation.

I see that you are on the right track, as you are already calling the /authorize endpoint to get a code to exchange it for an access token to the /oauth/token endpoint.

Everything looks correct. However, since you have not been getting the custom claims, I would recommend reviewing your Action script and using console.log() statements to debug and see what is preventing the claims from being appended.

I would also urge you to check out our Adding custom claims to tokens FAQ.

Please let me know how this goes for you.

Thanks,
Rueben