NokiaTube | New address | Mode Desktop | On high quality
Skip to content

Check parameterized type is username in ParameterizedScopeUserPropertyMapper - #55609

Merged
pedroigor merged 1 commit into
keycloak:mainfrom
rmartinc:issue-55608
Nov 27, 2026
Merged

pedroigor merged 1 commit into
keycloak:mainfrom
rmartinc:issue-55608

Conversation

@rmartinc

Copy link
Copy Markdown
Contributor

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.

@rmartinc
rmartinc requested a review from a team as a code owner November 27, 2026 08:43
Copilot AI balanced review requested due to automatic review settings November 27, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@stianst stianst added the kind/cve Issues identified as CVEs on third-party dependencies, or issues which Keycloak is not affected label Nov 27, 2026
@pedroigor
pedroigor merged commit f9f17c7 into keycloak:main Nov 27, 2026
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cve Issues identified as CVEs on third-party dependencies, or issues which Keycloak is not affected team/core-authn team/core-iam

Projects

None yet

4 participants