Repository navigation
[#1195] Advertise the routed token revocation URL and the introspection endpoint in OIDC discovery - #1198
Open
vharseko wants to merge 1 commit into
Open
[#1195] Advertise the routed token revocation URL and the introspection endpoint in OIDC discovery#1198vharseko wants to merge 1 commit into
vharseko wants to merge 1 commit into
Conversation
… and the introspection endpoint in OIDC discovery Since OpenIdentityPlatform#1058 the discovery document has advertised revocation_endpoint at <base>/revoke, but TokenRevocationResource is attached only at /token/revoke: the advertised URL falls through to the realm router, which takes "revoke" for a subrealm name and answers 404. Advertise <base>/token/revoke, the path the admin and developer guides document. Also advertise introspection_endpoint (RFC 8414), served at /introspect. DiscoveryEndpointRoutingTest resolves every endpoint the discovery document advertises through the OAuth2 router and checks that it reaches the resource implementing it.
maximthomas
approved these changes
Oct 23, 2026
maximthomas
left a comment
Contributor
There was a problem hiding this comment.
praise: The fix sits where the bug is, and the new test resolves the discovery document through the real router.
OAuth2UrisFactory.OAuth2UrisImpl.getRevocationEndpoint()now returns the pathOAuth2RouterProvideractually routes (/token/revoke), and no/revokeroute is added for a URL nobody could use.DiscoveryEndpointRoutingTestcovers every URL-valued keyOpenIDConnectProviderConfiguration.getConfigurationputs exceptissuer. It checks the resource each one reaches, not just the string, so the old/revokevalue fails there on the/{subrealm}route.- The JVM-wide empty module loader in
@BeforeSuiteis explained in the Javadoc, and the explanation holds. Without this class, the rest of theopenam-oauth2suite (899 tests) is green and loads noorg.forgerock.guice.coreclass.
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.
Fixes #1195
Problem
Since #1058 the OpenID Connect discovery document (
/oauth2/.well-known/openid-configuration) has advertisedrevocation_endpointat<base>/revoke, butTokenRevocationResourceis attached only at/token/revoke(OAuth2RouterProvider). A request to the advertised URL falls through to the default route ofRestletRealmRouter, which takesrevokefor a subrealm name, and answers 404, so a client that takes its endpoints from discovery never revokes a token. Affects 16.1.2, 16.1.3 and 16.1.4.Changes
OAuth2UrisFactory.OAuth2UrisImpl.getRevocationEndpoint()returns<base>/token/revoke, the routed path that the admin guide (chap-oauth2.adoc) and the developer guide (chap-client-dev.adoc) document. No route is added at/revoke: the advertised URL has never worked, so no client can depend on it.introspection_endpoint(RFC 8414), served at<base>/introspect.OAuth2Uris.getIntrospectionEndpoint()and the route already existed, but the endpoint was not published.Tests
DiscoveryEndpointRoutingTestbuilds the discovery document with the realOpenIDConnectProviderConfigurationandOAuth2UrisImpl, resolves every endpoint it advertises through the router thatOAuth2RouterProviderbuilds, and checks that each one reaches the resource implementing it:authorization,token,introspection,revocation,userinfo,check_session_iframe,end_session,jwks_uri,registrationanddevice_authorization.Before the fix, exactly two rows failed:
introspection_endpointwas absent, andrevocation_endpoint(…/oauth2/revoke) was routed toRestletRealmRouter$Delegate, the subrealm route. All ten pass after it, and the wholeopenam-oauth2suite passes (909 tests).Notes for review:
GuiceTestCase, soopenam-oauth2gets theorg.openidentityplatform.commons.guice:testtest dependency (version managed by the root pom, as inopenam-uma).openam-oauth2test classpath cannot build an injector without a configured OpenAM (no bindings for the scriptingScriptEvaluator/ScriptLogger), andGuiceTestCaseneedsInjectorHolderto build one before it overrides it. So the test sets an empty module loader from@BeforeSuite, asAuditContextFilterTestandInjectorHolderTestSupportdo. That setting is JVM wide; no other test in the module uses the injector, and the full suite runs green with it.chap-openid-connect.adocis an old snapshot ("version": "3.0", nodevice_authorization_endpoint), so it is left as is.