8000 Fix workflow grant/revoke role step selecting the wrong client role by sguilhen · Pull Request #55587 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix workflow grant/revoke role step selecting the wrong client role - #55587

Merged
pedroigor merged 1 commit into
keycloak:mainfrom
sguilhen:55468-workflow-role-slash
Nov 26, 2026
Merged

pedroigor merged 1 commit into
keycloak:mainfrom
sguilhen:55468-workflow-role-slash

Conversation

@sguilhen
Copy link
Copy Markdown
Contributor

RoleBasedStepProvider.getRole split the configured / value on every '/', so a client role name containing '/' (e.g. admin/child) was truncated to its first segment (admin) and the wrong role was granted or revoked.

Closes #55468

RoleBasedStepProvider.getRole split the configured <clientId>/<roleName> value on every '/',
so a client role name containing '/' (e.g. admin/child) was truncated to its first segment (admin)
and the wrong role was granted or revoked.

Closes keycloak#55468

Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
@sguilhen
sguilhen requested a review from a team as a code owner November 26, 2026 17:17
Copilot AI balanced review requested due to automatic review settings November 26, 2026 17:17
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 were identified for the change preserving slash-containing client role names.

No open issues 🎉

What changed in this PR

Fixes #55468 by preserving client role names containing / when workflow grant/revoke steps resolve configured roles, preventing selection of an unintended prefix role.

Changes:

  • Split role references only at the first /, preserving the full role name.
  • Add grant-role regression coverage for names containing multiple slashes and verify the prefix role is not granted.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​workflow/​step/​RoleBasedStepTest.java Adds regression coverage for slash-containing client role names.
services/​src/​main/​java/​org/​keycloak/​models/​workflow/​RoleBasedStepProvider.java Limits splitting to preserve the complete client role name.

Review effort: Balanced

@pedroigor
pedroigor enabled auto-merge (rebase) November 26, 2026 20:41
@pedroigor
pedroigor merged commit 0c51945 into keycloak:main Nov 26, 2026
157 of 159 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow grant step can select the wrong client role

3 participants

0