I have configured a server side application in Auth0 (Application Type = Regular Web app). I am using this for a trusted application that needs to use the Password grant. Both ID and access Tokens are issued as expected using
I need to add roles to the user using Flows and Actions. I am not able to find a suitable trigger that I can use to add roles to the token. The Post Login Flow which has the trigger onExecutePostLogin does not trigger.
What is the best way to add roles to tokens issued using the password grant type?
Hmm that’s odd! The password grant type (password-realm) as well should trigger a post login action. I just did a simple test using the password-realm grant type with the following action code - The roles were indeed added to the access token:
As long as there is a user log in involved (not client credentials) in the Web app flow then it should also be triggering the Action. If you go to Monitoring → Logs in your dashboard you should be able to see any successful logins. Within those events will be details on the Actions run (if any). This might be a good place to start!
Thanks for pointing me to the logs. I do see an entry for a successful login and that the action “Add user roles to Token” is getting triggered. However, the access and id tokens returned do not have the roles added