client role mapper to add roles to ID token and userinfo endpoint#15
Merged
Conversation
slominskir
requested changes
Jun 15, 2026
| } | ||
|
|
||
| update_client_roles_mapper() { | ||
| # Update the client-based roles scope so that a user's group IDs are put into the ID token, access token, and userinfo |
Member
There was a problem hiding this comment.
The access token has roles already by default and code below is only modifying id.token.claim and userinfo.token.claim
| export KC_SECRET=yHi6W2raPmLvPXoxqMA7VWbLAA2WN0eB | ||
| export KC_REALM_DISPLAY_NAME="TEST REALM" | ||
| export KC_SERVICE_ACCOUNT_ENABLED=true | ||
| export KC_UPDATE_CLIENT_ROLES_MAPPER=true |
Member
There was a problem hiding this comment.
We probably don't want this to be the default. We have about a dozen existing clients that don't use this feature and one client that will use it.
| - Each client will use the same client_secret: `yHi6W2raPmLvPXoxqMA7VWbLAA2WN0eB` | ||
| - Four users are created all with the password `password`: jadams, jdoe, jsmith, and tbrown | ||
| - All users have ${KC_RESOURCE}-user role. jdoe and tbrown have ${KC_RESOURCE}-admin role | ||
| - Client has KC_UPDATE_CLIENT_ROLES_MAPPER set to true by default |
Member
There was a problem hiding this comment.
See comment above. A questionable default since none of the existing clients use this.
Contributor
Author
|
Agree with comments. Updates made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add hooks to enable clients to get user role info in ID tokens and userinfo endpoint. Disables realm-based mapper on default configuration.