Fix executor permitted-resources test to use registered resource URI#1482
Closed
Copilot wants to merge 5 commits intoISSUE-41527from
Closed
Fix executor permitted-resources test to use registered resource URI#1482Copilot wants to merge 5 commits intoISSUE-41527from
Copilot wants to merge 5 commits intoISSUE-41527from
Conversation
…-in mapper Per @stianst's feedback in PR keycloak#35711: - Add resource.indicator.uri client attribute to OIDCConfigAttributes - Transform ResourceIndicatorMapper to a built-in mapper that validates resource indicators against client attributes and role scope - Register mapper in default roles scope (like AudienceResolveProtocolMapper) - Add validation at authorization endpoint (checkResourceIndicator) - Add INVALID_TARGET error code per RFC 8707 - Remove SecureResourceIndicatorExecutor (validation is now built-in) - Rewrite tests to use client attribute + role scope approach Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
…ty to public Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance RFC 8707 resource indicator support in Keycloak
RFC 8707: Replace mapper+executor approach with client attribute + built-in mapper
Feb 28, 2026
Bring back the SecureResourceIndicatorExecutor and its factory which provide the "permitted resources" client policy feature. This allows admins to restrict which resource indicator values are allowed via client policies, and ensures token request consistency checks. The executor works alongside the built-in ResourceIndicatorMapper: - Mapper: resolves resource URIs to audience claims via client attributes - Executor: enforces permitted resources and token request consistency Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot
AI
changed the title
RFC 8707: Replace mapper+executor approach with client attribute + built-in mapper
RFC 8707: Resource indicator support via client attribute + built-in mapper with executor policy enforcement
Feb 28, 2026
…or executor check
The test used an unregistered resource URI ("https://different.resource.example.com/")
to test the executor's permitted-resources rejection. However,
AuthorizationEndpointChecker.checkResourceIndicator() runs BEFORE the executor and
rejects unknown URIs with INVALID_TARGET error. The executor never gets a chance to run.
Fix: Use RESOURCE_SERVER_URI_2 (which IS registered with a client but NOT in the
permitted resources list) so checkResourceIndicator() passes and the executor
can properly validate against the permitted resources.
Co-authored-by: tnorimat <25092005+tnorimat@users.noreply.github.com>
Copilot
AI
changed the title
RFC 8707: Resource indicator support via client attribute + built-in mapper with executor policy enforcement
Fix executor permitted-resources test to use registered resource URI
Feb 28, 2026
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.
Description
testExecutorWithPermittedResourceshad a bug: it used an unregistered resource URI to test theSecureResourceIndicatorExecutor's permitted-resources rejection. This can never work becauseAuthorizationEndpointChecker.checkResourceIndicator()runs before client policy executors and rejects unknown URIs withINVALID_TARGET— the executor never executes.The test expected
INVALID_REQUEST/ERR_NOT_PERMITTED_RESOURCEfrom the executor, but would getINVALID_TARGET/"Invalid resource indicator: ..."from the endpoint checker.Fix: Use
RESOURCE_SERVER_URI_2(registered client, passes endpoint check) instead of a fabricated URL, and restrictpermittedResourcesto onlyRESOURCE_SERVER_URIso the executor properly rejects the second URI.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.gradle.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher compile -pl services -am -DskipTests -q(dns block)repository.jboss.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher compile -pl services -am -DskipTests -q(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/keycloak/keycloak org.codehaus.plexus.classworlds.launcher.Launcher compile test-compile -pl tests/base -am -DskipTests -q(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.