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
token-exchange impersonation does not work without information about roles in the token
#14371
Our system uses a minimalistic token that does not include realm roles and client roles. everything worked fine - after token validation we get all the information about user roles and groups from /userinfo. But recently we need to enable token-exchange functionality to use impersonation via API and we have a problem - endpoint gives a 403 "Client not allowed to exchange" error until put the role information back into the token.
Can you tell me if it's a bug or am I doing something wrong?
I would like to continue to have a minimalistic token and use the token-exchange functionality.
For reproduce:
set up keycloak 19+ with the token-exchange feature turned on
create realm
create public client
remove "roles" from client scopes of the client or set it as optional or disable "Add to ID token" and "Add to access token" in realm roles and client roles mappers of client scope "roles" globally
create privileged user (aka moderator) with role "realm-management: impersonation"
If you disable "Full scope allowed" from the scope of our public client and add to him role "realm-management: impersonation" then this role appears in the token (only it one! well, it's the compromise!) and token-exchange will work, but other user roles stop coming from /userinfo - only this one now (f**k!!!).
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.
Uh oh!
There was an error while loading. Please reload this page.
Our system uses a minimalistic token that does not include realm roles and client roles. everything worked fine - after token validation we get all the information about user roles and groups from /userinfo. But recently we need to enable token-exchange functionality to use impersonation via API and we have a problem - endpoint gives a 403 "Client not allowed to exchange" error until put the role information back into the token.
Can you tell me if it's a bug or am I doing something wrong?
I would like to continue to have a minimalistic token and use the token-exchange functionality.
For reproduce:
If you disable "Full scope allowed" from the scope of our public client and add to him role "realm-management: impersonation" then this role appears in the token (only it one! well, it's the compromise!) and token-exchange will work, but other user roles stop coming from /userinfo - only this one now (f**k!!!).
All reactions