Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to other token types when given incorrect hint #1607

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

josephdecock
Copy link
Member

When the token type hint parameter is incorrect, we now fall back and try the other type of token (either refresh or access). But, we only do this for clients - apis cannot use refresh tokens, so they still get a response of { "isActive": false } if they attempt to introspect a refresh token. In either case, bogus token_type_hints are not an error anymore, either.

For reference, RFC 7662 Section 2.1:

If the server is unable to locate the token using the given hint, it MUST extend its search across all of its supported token types.

Resolves #1578

When the token type hint parameter is incorrect, we now fall back and try the other type of token (either refresh or access). But, we only do this for clients - apis cannot use refresh tokens, so they still get a response of { "isActive": false } if they attempt to introspect a refresh token. In either case, bogus token_type_hints are not an error anymore, either.

For reference, RFC 7662 Section 2.1:
> If the server is unable to locate the token using the given hint, it MUST extend its search across all of its supported token types.
Brock and I discussed this, and we don't want to change default behavior here because there could be scenarios where you want to introspect a token even though you're not really "consuming" it (maybe some kind of gateway). And you can do this today via a decorator on the introspection request validator
@brockallen brockallen merged commit 6d1a9a5 into main Sep 27, 2024
5 checks passed
@brockallen brockallen deleted the joe/introspection branch September 27, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fall back to other token types when passed an invalid token_type_hint
2 participants