Repository navigation
Description
What happened?
Since v0.61.0 (#29117), /mcp auth <server> fails for any MCP server whose authorization server publishes RFC 8414 metadata with an issuer but does not return iss in the authorization response:
x Failed to authenticate with MCP server '<name>': Missing "iss" parameter in authorization response per RFC 9207
The same server authenticated fine on v0.56.0. This hits every server backed by Supabase Auth's OAuth 2.1 server, which does not emit iss today (supabase/auth authorize.go, buildSuccessRedirectURL).
The check is in packages/core/src/utils/oauth-flow.ts:268-290 @ v0.61.0:
if (expectedIssuer) {
// Fail-closed: if an issuer was expected, the response MUST include it
if (!iss) {
...
reject(new Error('Missing "iss" parameter in authorization response per RFC 9207'));expectedIssuer is config.issuer (oauth-provider.ts:400-408), and discovery sets that from the metadata issuer of any server it finds (oauth-utils.ts:308-318). As a result, every discovered server is required to send iss. The code never reads authorization_response_iss_parameter_supported.
What did you expect to happen?
The missing-iss rejection should apply only when the authorization server advertises authorization_response_iss_parameter_supported: true. When iss is present, it should still be compared against the expected issuer.
- MCP spec 2026-07-28, Authorization ("Authorization Server Issuer Identification"): the client decision table says that when
authorization_response_iss_parameter_supportedisfalseor absent andissis absent, the client should Proceed. The spec also says: "client rejection behavior onissabsence will continue to be keyed onauthorization_response_iss_parameter_supporteduntil that revision defines the upgrade path." (source) - RFC 9207 §2.4: clients must reject a response without
issonly when the authorization server supports the parameter "according to the client's configuration". §3 definesauthorization_response_iss_parameter_supportedand says: "If omitted, the default value is false." Rejecting everyiss-less response is allowed only as local policy, and for MCP clients the MCP spec sets that policy: proceed. - The reference MCP SDKs already key the missing-
issrejection on the flag:validateAuthorizationResponseIssuerin the TypeScript SDK (packages/client/src/client/auth.ts), andvalidate_authorization_response_issuerin rmcp (crates/rmcp/src/transport/auth.rs).
Suggested fix: carry authorization_response_iss_parameter_supported from metadataToOAuthConfig through to startCallbackServer, and reject a missing iss only when that flag is true. If you want to keep stricter behavior as an opt-in, also reject when the user configured issuer explicitly.
Repro
- Gemini CLI 0.61.0 with a remote MCP server whose AS metadata has
issuerand noauthorization_response_iss_parameter_supported(for example, any Supabase OAuth 2.1 server). - Run
/mcp auth <server>and approve in the browser. - Expected: the authorization code is exchanged for tokens. Actual:
Missing "iss" parameter in authorization response per RFC 9207.
Client information
Client Information
- Gemini CLI 0.61.0 (auto-updated from 0.56.0). The failure does not happen on 0.56.0.
- macOS 26.7 (arm64), Node v24.15.0
/aboutoutput was not captured for this run.
Login information
Not relevant to this bug. The failure is in the MCP server OAuth flow (/mcp auth), not in Gemini account login.
Anything else we need to know?
Discussion #29428 describes the same behavior as a server-side gotcha ("add iss to every /oauth/authorize redirect"). Servers should send iss (the MCP spec makes that a SHOULD), and we are adding it on our side. However, servers whose authorization server can't emit it yet are locked out on 0.61, even though the spec says to proceed.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsClosed
Activity
Ben-Home commentedon Sep 30, 2026
Solid diagnosis. The fix should key the fail-closed check on the RFC 8414 flag
authorization_response_iss_parameter_supported, and there are two sides to wire, not just one:issin the authorization request only when the AS advertisesauthorization_response_iss_parameter_supported: true. Absent the flag, RFC 8414 sec 2 defaults to the least permissive value (false), so the client must not sendissat all.expectedIssueron the same flag, not on the presence ofissuerin the metadata. If the client never requestedissbut the response carries one anyway, comparing it against the metadata issuer is fine as defense in depth; rejecting a missing one is not, because a server that never negotiated the extension is not required to emit it (RFC 9207 sec 2.4).One subtlety for the compare-when-present path: once the flag is honored, the issuer check can stay fail-closed for servers that do advertise support, since that is the only case where a missing
issis a genuine anomaly.The Supabase Auth example matters beyond this repo: any OAuth 2.1 server that skips
issbreaks under v0.61.0 even though it behaved fine before, so this is a regression with a wide blast radius, not an edge case. Worth a regression test covering all four combinations: (flag false, iss absent) proceed, (flag false, iss present) compare, (flag true, iss present) compare, (flag true, iss absent) reject.We hit the same flag-absent semantics in our production connectors at corpusiq.io; treating the metadata
issueras an implied contract rather than an explicit negotiation is the recurring mistake across client implementations.dimpavloff commentedon Sep 30, 2026
Also affected by this
fix(core): align OAuth callback iss parameter validation with RFC 920…
fix(core): align OAuth callback iss parameter validation with RFC 920…
fix(core): align OAuth callback iss parameter validation with RFC 920…