Skip to content

feat(oauth): add configurable token introspection for Google OAuth - #65

Merged
NP-compete merged 3 commits into
redhat-data-and-ai:mainfrom
abhiskum:feat/oauth-introspection-mode
Jun 12, 2026
Merged

feat(oauth): add configurable token introspection for Google OAuth#65
NP-compete merged 3 commits into
redhat-data-and-ai:mainfrom
abhiskum:feat/oauth-introspection-mode

Conversation

@abhiskum

@abhiskum abhiskum commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

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).

abhiskum and others added 2 commits June 7, 2026 21:11
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-commenter

codecov-commenter commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@abhiskum

abhiskum commented Jun 7, 2026

Copy link
Copy Markdown
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.
@NP-compete
NP-compete merged commit 7112f47 into redhat-data-and-ai:main Jun 12, 2026
3 checks passed
Vallabh2909 pushed a commit to Vallabh2909/template-mcp-server that referenced this pull request Jun 16, 2026
Vallabh2909 pushed a commit to Vallabh2909/template-mcp-server that referenced this pull request Jun 16, 2026
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.

3 participants