Skip to content

MCP OAuth: RFC 9207 check rejects iss-less callbacks from servers that do not advertise authorization_response_iss_parameter_supported #29477

Closed

Description

@harveyfullstack

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_supported is false or absent and iss is absent, the client should Proceed. The spec also says: "client rejection behavior on iss absence will continue to be keyed on authorization_response_iss_parameter_supported until that revision defines the upgrade path." (source)
  • RFC 9207 §2.4: clients must reject a response without iss only when the authorization server supports the parameter "according to the client's configuration". §3 defines authorization_response_iss_parameter_supported and says: "If omitted, the default value is false." Rejecting every iss-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-iss rejection on the flag: validateAuthorizationResponseIssuer in the TypeScript SDK (packages/client/src/client/auth.ts), and validate_authorization_response_issuer in 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

  1. Gemini CLI 0.61.0 with a remote MCP server whose AS metadata has issuer and no authorization_response_iss_parameter_supported (for example, any Supabase OAuth 2.1 server).
  2. Run /mcp auth <server> and approve in the browser.
  3. 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
  • /about output 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.

Activity

  1. added
    status/need-triage
    area/security
    priority/p1
    and removed
    status/need-triage
    on Sep 24, 2026
  2. added theissue type on Sep 24, 2026
  3. Ben-Home commented on Sep 30, 2026

    @Ben-Home

    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:

    1. Request side (currently missing): per RFC 9207 sec 2.1, the client should include iss in the authorization request only when the AS advertises authorization_response_iss_parameter_supported: true. Absent the flag, RFC 8414 sec 2 defaults to the least permissive value (false), so the client must not send iss at all.
    2. Response side: gate expectedIssuer on the same flag, not on the presence of issuer in the metadata. If the client never requested iss but 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 iss is a genuine anomaly.

    The Supabase Auth example matters beyond this repo: any OAuth 2.1 server that skips iss breaks 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 issuer as an implied contract rather than an explicit negotiation is the recurring mistake across client implementations.

  4. dimpavloff commented on Sep 30, 2026

    @dimpavloff

    Also affected by this

  5. added 3 commits that reference this issue on Oct 2, 2026
    416e295
    c5ca57d
    19ad184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/securitykind/bugpriority/p1status/bot-triaged

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions