MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / Authorize

Method Authorize

auth/client.go:39–39  ·  view source on GitHub ↗

Authorize is called when an HTTP request results in an error that may be addressed by the authorization flow (currently 401 Unauthorized and 403 Forbidden). It is responsible for performing the OAuth flow to obtain an access token. The arguments are the request that failed and the response that was

(context.Context, *http.Request, *http.Response)

Source from the content-addressed store, hash-verified

37 // After a successful call to Authorize, the HTTP request will be retried by the transport.
38 // The function is responsible for closing the response body.
39 Authorize(context.Context, *http.Request, *http.Response) error
40}

Callers 1

WriteMethod · 0.65

Implementers 5

AuthorizationCodeHandlerauth/authorization_code.go
ClientCredentialsHandlerauth/extauth/client_credentials.go
EnterpriseHandlerauth/extauth/enterprise_handler.go
mockOAuthHandlermcp/streamable_client_test.go
blockingCountingOAuthHandlermcp/streamable_client_test.go

Calls

no outgoing calls

Tested by

no test coverage detected