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

Method TokenSource

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

TokenSource returns a token source to be used for outgoing requests. Returned token source might be nil. In that case, the transport will not add any authorization headers to the request.

(context.Context)

Source from the content-addressed store, hash-verified

26 // Returned token source might be nil. In that case, the transport will not
27 // add any authorization headers to the request.
28 TokenSource(context.Context) (oauth2.TokenSource, error)
29
30 // Authorize is called when an HTTP request results in an error that may
31 // be addressed by the authorization flow (currently 401 Unauthorized and 403 Forbidden).

Callers 3

AuthorizeMethod · 0.65
setMCPHeadersMethod · 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