Skip to content

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

Merged
brockallen merged 3 commits intomainfrom
joe/introspection
Sep 27, 2024
Merged

Fall back to other token types when given incorrect hint during introspection#1607
brockallen merged 3 commits intomainfrom
joe/introspection

Conversation

@josephdecock
Copy link
Copy Markdown
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
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

3 participants