Skip to content

Handle non-token matches in introspect and revoke - #20111

Open
shlee1223 wants to merge 1 commit into
spring-projects:mainfrom
shlee1223:fix-introspect-revoke-state-match
Open

shlee1223 wants to merge 1 commit into
spring-projects:mainfrom
shlee1223:fix-introspect-revoke-state-match

Conversation

@shlee1223

Copy link
Copy Markdown

Hi!

findByToken(token, null) also matches the state attribute, so a value equal to a stored state (e.g. from a PAR request_uri) finds an authorization with no matching token, and the introspection and revocation providers fail with an IllegalArgumentException.

This treats that case as "token not found", which returns "active": false (RFC 7662 §2.2) and 200 for revocation (RFC 7009 §2.2). Tests added.

findByToken(token, null) also matches the state attribute, so a
value equal to a stored state (for example the PAR request_uri
reference) found an authorization without a matching token. The
providers then failed an assertion and the request ended with an
IllegalArgumentException.

Treat that case as an unknown token: introspection returns an
inactive response (RFC 7662 section 2.2) and revocation returns
success without revoking anything (RFC 7009 section 2.2).

Signed-off-by: shlee1223 <shlee1223@raoncorp.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants