Authenticating using Azure connection and getting idToken on success.
The requirement is to read roles and permission for logged-in to restrict pages based on roles and permission.
Please guide us on how to achieve this.
Thanks for joining the Community!
You can add the role/permissions to the ID Token or Access Token by using a custom claim in a Rule.
Here is a related topic that shows you how to add permissions to the ID Token: Accessing the permissions array in the access token - #10 by ryantomaselli
And here is how to add the user roles to tokens: Sample Use Cases: Rules with Authorization
Let me know if you have any questions about these examples!
Thank you, Stephanie, for your help, I am able to get roles now. one small question can I change the name from link to roles? when I change it was not returning roles.
Any custom claims must be namespaced to be OIDC-compliant so that your claims won’t collide with reserved claims. This is typically done with a URI such as
So you can change the URI to something specific to your app, but it’s recommended that you use a URI as the namespace.
You can read more about namespacing custom claims here:
Thank you @stephanie.chamblee for your help.
No problem! Happy to help!
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.