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

OAuth2Client: use correct auth method for token introspection #662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdamWill
Copy link

When token introspection was introduced in 6f5d19a, using the code that previously only handled token revocation, the new _handle_token_hint method that does the work for both introspect_token and revoke_token kept using
self.revocation_endpoint_auth_method unconditionally if no auth was passed in with the introspect or revoke request. This seems to be wrong, introspecting a token should use the token_endpoint_auth_method.

This leaves the fallback to revocation_endpoint_auth_method in _handle_token_hint because adjusting its signature to make auth compulsory would be awkward, but it's not expected ever to be used.

What kind of change does this PR introduce? (check at least one)

  • Bugfix

Does this PR introduce a breaking change? (check one)

  • No

  • You consent that the copyright of your pull request source code belongs to Authlib's author.

When token introspection was introduced in 6f5d19a, using the
code that previously only handled token revocation, the new
`_handle_token_hint` method that does the work for both
`introspect_token` and `revoke_token` kept using
`self.revocation_endpoint_auth_method` unconditionally if no
`auth` was passed in with the introspect or revoke request.
This seems to be wrong, introspecting a token should use the
`token_endpoint_auth_method`.

This leaves the fallback to `revocation_endpoint_auth_method`
in `_handle_token_hint` because adjusting its signature to make
`auth` compulsory would be awkward, but it's not expected ever
to be used.

Signed-off-by: Adam Williamson <[email protected]>
@AdamWill
Copy link
Author

As I work for Red Hat I cannot agree to "consent that the copyright of your pull request source code belongs to Authlib's author" without my employer's permission, but I think this change is too trivial to be copyrightable.

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.

1 participant