You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using predefined "roles" client scope to include roles in access token
#20801
I need to have the user roles included in the access token returned by Keycloak.
Reading around one recommended way to achieve this is to modify the automatically created -dedicated client scope to add the "client-roles" and/or "realm-roles" mappers.
There is however an automatically defined "roles" client scope in the realm ("OpenID Connect scope for add user roles to the access token"). I can modify that client scope to enable "Include in token scope".
Once I do that I can use for example scope=openid roles email in my access token requests to obtain the roles.
Is there any drawback in using that predefined client scope as opposed to adding mappers to the dedicated scope?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I need to have the user roles included in the access token returned by Keycloak.
Reading around one recommended way to achieve this is to modify the automatically created -dedicated client scope to add the "client-roles" and/or "realm-roles" mappers.
There is however an automatically defined "roles" client scope in the realm ("OpenID Connect scope for add user roles to the access token"). I can modify that client scope to enable "Include in token scope".
Once I do that I can use for example scope=openid roles email in my access token requests to obtain the roles.
Is there any drawback in using that predefined client scope as opposed to adding mappers to the dedicated scope?
Thanks!
All reactions