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

Struct ClientCredentialsHandler

auth/extauth/client_credentials.go:47–50  ·  view source on GitHub ↗

ClientCredentialsHandler is an implementation of [auth.OAuthHandler] that uses the OAuth 2.0 Client Credentials grant (RFC 6749 Section 4.4) to obtain access tokens. This handler is intended for service-to-service authentication where the client has pre-registered credentials (client ID and secret)

Source from the content-addressed store, hash-verified

45// Resource Metadata (RFC 9728) and Authorization Server Metadata (RFC 8414),
46// following the ext-auth specification SEP-1046.
47type ClientCredentialsHandler struct {
48 config *ClientCredentialsHandlerConfig
49 tokenSource oauth2.TokenSource
50}
51
52// Compile-time check that ClientCredentialsHandler implements auth.OAuthHandler.
53var _ auth.OAuthHandler = (*ClientCredentialsHandler)(nil)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected