feat(oauth): add configurable token introspection for Google OAuth - #65
Merged
NP-compete merged 3 commits intoJun 12, 2026
Merged
Conversation
Google OAuth lacks RFC 7662 introspection, which caused bearer token validation to fail on protected routes. Introduce SSO_INTROSPECTION_MODE with pluggable rfc7662 and tokeninfo strategies so providers like Google can be configured explicitly without hardcoded URL detection. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
@tuhinsharma121 @NP-compete Please review this change related to support google oauth in production. |
Add tests for normalize_response branches and unexpected introspection errors so patch coverage meets the Codecov threshold.
Vallabh2909
pushed a commit
to Vallabh2909/template-mcp-server
that referenced
this pull request
Jun 16, 2026
…edhat-data-and-ai#65) Co-authored-by: Cursor <cursoragent@cursor.com>
Vallabh2909
pushed a commit
to Vallabh2909/template-mcp-server
that referenced
this pull request
Jun 16, 2026
…edhat-data-and-ai#65) Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Google OAuth does not expose an RFC 7662 token introspection endpoint, so bearer token validation on protected routes failed when using the default POST introspection flow. This MR introduces pluggable introspection strategies so providers like Google can be configured explicitly.
Add SSO_INTROSPECTION_MODE (rfc7662 | tokeninfo) with a new introspection.py module implementing Rfc7662Introspector (Keycloak, Auth0, Okta) and TokenInfoIntrospector (Google tokeninfo via GET ?access_token=...)
Refactor OAuth2Handler.introspect_token() to delegate to the configured strategy; normalize tokeninfo responses to RFC 7662 { "active": true } shape, including audience (aud/azp) checks and exp coercion
Document Google OAuth setup in docs/authentication.md and .env.example; default remains rfc7662 for backward compatibility
Related (already merged): #22 — configurable OAuth scopes via SSO_SCOPES (needed for Google scope URLs).