Repository navigation
Use the selected client when evaluating authorization policies - #55494
Open
JBoogieman wants to merge 1 commit into
Open
JBoogieman wants to merge 1 commit into
JBoogieman wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
🟢 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
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.
Closes #16597
Decisions and assumptions:
clientKey="id"), becausePolicyEvaluationServicelooks the client up withgetClientById. The client policy form already uses the select the same way.clientIdis left out of the request, so the server keeps falling back to the resource server's client as before.Generative AI (Claude) was used to help write and test this change.