1515 1. [Token Passthrough](#token-passthrough)
1616 1. [Server-Side Request Forgery (SSRF)](#server-side-request-forgery-(ssrf))
1717 1. [Session Hijacking](#session-hijacking)
18+ 1. [Issuer Mix-Up](#issuer-mix-up)
18191 . [ Utilities] ( #utilities )
1920 1. [Cancellation](#cancellation)
2021 1. [Ping](#ping)
@@ -327,6 +328,7 @@ This handler supports:
327328- [ Client ID Metadata Documents] ( https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#client-id-metadata-documents )
328329- [ Pre-registered clients] ( https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#preregistration )
329330- [ Dynamic Client Registration] ( https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#dynamic-client-registration )
331+ - [ RFC 9207] ( https://www.rfc-editor.org/rfc/rfc9207 ) Authorization Server Issuer Identification
330332
331333To use it, configure the handler and assign it to the transport:
332334
@@ -338,11 +340,12 @@ authHandler, _ := auth.NewAuthorizationCodeHandler(&auth.AuthorizationCodeHandle
338340 // PreregisteredClientConfig: ...
339341 // DynamicClientRegistrationConfig: ...
340342 AuthorizationCodeFetcher : func (ctx context.Context , args *auth.AuthorizationArgs ) (*auth.AuthorizationResult , error ) {
341- // Open the args.URL in a browser and return the resulting code and state .
343+ // Open the args.URL in a browser and return the resulting code, state, and iss .
342344 // See full example in examples/auth/client/main.go.
343345 code := ...
344346 state := ...
345- return &auth.AuthorizationResult {Code: code, State: state}, nil
347+ iss := ... // "iss" query parameter from the redirect URI (RFC 9207)
348+ return &auth.AuthorizationResult {Code: code, State: state, Iss: iss}, nil
346349 },
347350})
348351
@@ -426,6 +429,22 @@ sets `UserID` on the returned `TokenInfo`, the streamable transport will:
426429 ` TokenInfo.UserID ` to enable this protection. This prevents an attacker with a valid
427430 token from hijacking another user's session by guessing or obtaining their session ID.
428431
432+ ### Issuer Mix-Up
433+
434+ The [ mitigation] ( https://www.rfc-editor.org/rfc/rfc9207 ) against issuer mix-up attacks is
435+ implemented per [ RFC 9207] ( https://www.rfc-editor.org/rfc/rfc9207 ) . The SDK client validates
436+ the ` iss ` parameter in authorization responses to ensure they originated from the expected
437+ authorization server:
438+
439+ - If ` iss ` is present in the redirect URI, the SDK verifies it matches the issuer from the
440+ authorization server's metadata. A mismatch results in an error.
441+ - If ` iss ` is absent but the authorization server advertises
442+ ` authorization_response_iss_parameter_supported: true ` in its [ RFC 8414] ( https://www.rfc-editor.org/rfc/rfc8414 )
443+ metadata, the SDK rejects the response with an error.
444+
445+ The ` AuthorizationCodeFetcher ` is responsible for extracting the ` iss ` query parameter from
446+ the redirect URI and returning it in [ ` AuthorizationResult.Iss ` ] ( https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk/auth#AuthorizationResult ) .
447+
429448## Utilities
430449
431450### Cancellation
0 commit comments