Repository navigation
Conversation
Closes keycloak#50527 Signed-off-by: kanywst <45947799+kanywst@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the AuthZEN scope and audience restrictions.
No open issues 🎉
What changed in this PR
Restricts access to Keycloak’s AuthZEN endpoints to tokens containing the authzen scope and the
8000
realm-specific AuthZEN audience, addressing #50527.
Changes:
- Enforces scope and audience checks, returning
401 Unauthorizedwhen either requirement is unmet. - Updates test clients and adds rejection tests for missing scope and incorrect audience.
- Documents manual client-scope setup and the upgrade requirement.
| File | Description |
|---|---|
docs/guides/securing-apps/authzen-authorization.adoc |
Explains token requirements and client-scope configuration. |
docs/documentation/upgrading/topics/changes/changes-27_0_0.adoc |
Documents the new authentication requirements for upgrades. |
authzen/tests/base/src/test/java/org/keycloak/tests/authzen/AuthZenScope.java |
Adds a shared helper to configure the scope and audience mapper. |
authzen/tests/base/src/test/java/org/keycloak/tests/authzen/AuthZenEvaluationTest.java |
Configures test clients and tests rejection of missing scope and incorrect audience. |
authzen/tests/base/src/test/java/org/keycloak/tests/authzen/AuthZenEvaluationsTest.java |
Configures test clients and tests missing-scope rejection for batch evaluations. |
authzen/tests/base/src/test/java/org/keycloak/tests/authzen/AuthZenEvaluationInteropTest.java |
Configures the interoperability client with the required scope and audience. |
authzen/services/src/main/java/org/keycloak/authorization/authzen/AuthZenWellKnownProvider.java |
Adds audience helpers based on the realm’s frontend URL. |
authzen/services/src/main/java/org/keycloak/authorization/authzen/AuthZenResource.java |
Enforces audience and scope validation during authentication. |
authzen/services/src/main/java/org/keycloak/authorization/authzen/AuthZen.java |
Defines the shared authzen scope constant. |
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 #50527
The
authzenclient scope isn't created automatically; the guide covers adding it with an audience mapper. A missing scope or wrong audience returns 401, same as the other authentication failures inAuthZenResource.AI disclosure: AI agents assisted with implementation and tests.