Repository navigation
Make UMA ticket resource resolution independent of permission order - #55591
Open
sakshichitnis27 wants to merge 1 commit into
Open
sakshichitnis27 wants to merge 1 commit into
sakshichitnis27 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change making UMA unresolved-resource errors independent of permission order.
No open issues 🎉
What changed in this PR
Addresses #55472 by making UMA ticket requests with unresolvable resource names behave consistently regardless of permission order.
Changes:
- Defers
invalid_resourceuntil permission processing finishes, preserving the first unresolved resource in the error and the existing error event. - Adds regression tests for unknown resources, resources owned by another user, and requests where no resource resolves.
- Adds a test helper for sending multiple permission parameters.
| File | Description |
|---|---|
tests/utils-shared/src/main/java/org/keycloak/testsuite/util/oauth/PermissionGrantRequest.java |
Adds a fluent helper for appending permission parameters. |
tests/base/src/test/java/org/keycloak/tests/authz/services/uma/UmaGrantTypeTest.java |
Tests order-independent resolution and unresolved-resource errors. |
services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java |
Tracks unresolved resources and defers the error check until after processing. |
Review effort: Balanced
Closes keycloak#55472 Signed-off-by: sakshichitnis27 <sakshigchitnis27@gmail.com>
sakshichitnis27
force-pushed
the
issue-55472-uma-permission-order
branch
from
November 27, 2026 00:11
499d340 to
4c729ce
Compare
Comment on lines
+530
to
+532
| if (!resolved && unresolvedResourceId == null) { | ||
| unresolvedResourceId = resourceId; | ||
| } |
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 #55472
The
invalid_resourcecheck now runs once, after all requested permissions were processed, instead of while the first one is resolved.Decisions and assumptions:
invalid_resourceif no requested permission could be resolved. This matches what already happened when an unresolvable resource was not the first one, and keeps the existing result for single-resource requests. The alternative (always fail on any unresolvable resource) would turn requests that succeed today into errors, so I did not pick it; happy to change it if maintainers prefer that.PERMISSION_TOKEN_ERRORevent is still fired.invalid_scopewhere it previously never got that far.This change and its tests were written with the help of an AI coding agent (Claude Code).