fix(mcp): use full OIDC round-trip for MCP OAuth to avoid id_token issuer mismatch#30446
Closed
Vishnuujain wants to merge 1 commit into
Closed
fix(mcp): use full OIDC round-trip for MCP OAuth to avoid id_token issuer mismatch#30446Vishnuujain wants to merge 1 commit into
Vishnuujain wants to merge 1 commit into
Conversation
Code Review ✅ ApprovedSwitches MCP OAuth to use a full OIDC round-trip instead of the active-session shortcut, preventing id_token issuer mismatches. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Contributor
🔴 Playwright Results — 2 test failure(s)✅ 4533 passed · ❌ 2 failed · 🟡 24 flaky · ⏭️ 102 skipped
Genuine Failures (failed on all attempts)❌
|
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.
Fixes #30445
Problem
MCP OAuth (e.g. ChatGPT connector) fails on instances with OIDC SSO.
POST /mcp/callbackreturns 500:Fix
AuthenticationCodeFlowHandler: skip the active-session shortcut for MCP flows so the id_token always comes from the external OIDC provider; expose the round-tripstate/nonce/PKCE-verifier as request attributes.UserSSOOAuthProvider: link those to the MCP pending request viaupdatePac4jSession, so the returning/callback?state=...resolves and a provider-issued id_token is validated.Web login path is untouched (guarded behind
!isMcpFlow).Not covered here
Live ChatGPT↔SSO end-to-end round-trip — needs verification on a deployed instance.
Greptile Summary
The PR repairs MCP authentication for OIDC deployments by:
Confidence Score: 5/5
The PR appears safe to merge, with no blocking failure identified in the follow-up scope.
No blocking failure remains.
Important Files Changed
Sequence Diagram
Reviews (2): Last reviewed commit: "fix(mcp): use full OIDC round-trip for M..." | Re-trigger Greptile
Context used: