8000 Use the selected client when evaluating authorization policies by JBoogieman · Pull Request #55494 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Use the selected client when evaluating authorization policies - #55494

Open
JBoogieman wants to merge 1 commit into
keycloak:mainfrom
JBoogieman:issue-16597
Open

JBoogieman wants to merge 1 commit into
keycloak:mainfrom
JBoogieman:issue-16597

Conversation

@JBoogieman
Copy link
Copy Markdown
Contributor

Closes #16597

Decisions and assumptions:

  • The Evaluate tab's client select now stores the client's internal id (clientKey="id"), because PolicyEvaluationService looks the client up with getClientById. The client policy form already uses the select the same way.
  • When no client is selected, clientId is left out of the request, so the server keeps falling back to the resource server's client as before.
  • The new Playwright test uses a client policy that only permits a second client: the default selection gets Deny, and selecting the second client gets Permit. Without the fix, the second case also gets Deny.

Generative AI (Claude) was used to help write and test this change.

The Evaluate tab's client select stored the selected client's clientId, but the request read an id property from that string, so clientId was never sent and the server always evaluated as the resource server's client. The select now stores the client's id, which is what the evaluation endpoint expects, and the request sends it.

Closes keycloak#16597

Signed-off-by: Justin Brueggemann <167224505+JBoogieman@users.noreply.github.com>
@JBoogieman
JBoogieman marked this pull request as ready for review November 24, 2026 21:49
@JBoogieman
JBoogieman requested review from a team as code owners November 24, 2026 21:49
Copilot AI balanced review requested due to automatic review settings November 24, 2026 21:49
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 to evaluate authorization policies using the selected client’s internal ID.

No open issues 🎉

What changed in this PR

Fixes #16597 by passing the selected client’s internal ID to authorization policy evaluation, so evaluation uses the chosen client rather than always falling back to the resource server client.

Changes:

  • Stores and submits the selected client’s internal ID.
  • Preserves server fallback when no client is selected.
  • Adds Playwright regression tests for default and selected-client evaluation.
File Description
js/​apps/​admin-ui/​test/​clients/​authorization.spec.ts Tests Deny for the default client and Permit for the explicitly selected client.
js/​apps/​admin-ui/​src/​clients/​authorization/​AuthorizationEvaluate.tsx Uses internal client IDs in the selector and evaluation request.

Review effort: Balanced

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.

The client set in the evaluation is not the client set to the azp claim when running the evaluation tool

2 participants

0