Repository navigation
Check parameterized type is username in ParameterizedScopeUserPropertyMapper - #55609
Merged
Merged
Conversation
…yMapper Closes keycloak#55608 Signed-off-by: rmartinc <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change restricting user-property claim mapping to username-based parameterized scopes.
No open issues 🎉
What changed in this PR
This PR addresses #55608 by restricting user-property claim mapping to username-based parameterized scopes, preventing other scope types from bypassing target-user authorization checks.
Changes:
- Skip user-property mapping for non-username scope types while preserving authorization checks for supported types.
- Update test scope configurations and add regression coverage confirming string scopes retain raw parameter claims but omit user-property claims.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/oauth/ParameterizedScopeMapperTest.java |
Uses explicit scope types, adjusts expectations, and tests rejection of non-username user-property mapping. |
services/src/main/java/org/keycloak/protocol/oidc/mappers/ParameterizedScopeUserPropertyMapper.java |
Requires a UsernameScopeType provider before resolving user properties and checking access. |
Review effort: Balanced
pedroigor
approved these changes
Nov 27, 2026
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.
Closes #55608
Just checking the type of the parameterized scope mapper is UsernameScopeType. If not the ParameterizedScopeUserPropertyMapper just returns without adding any claim in the token. One test added and the rest are modified to act as expected.