Skip to content

Client Credentials Grant

RFC 6749 §4.4 · package rfc6749/client_credentials

Implements the Client Credentials Grant, for service-to-service calls where no end user is present. See OAuth 2.0 Flows.

Construction

go
import clientcredentials "github.com/alkeyio/authkit/rfc6749/client_credentials"

flow, err := clientcredentials.Must(
    clientcredentials.NewConfig().
        SetClientManager(clientMgr).
        SetTokenManager(tokenMgr),
)

Required dependencies

SetterManager interfacePurpose
SetClientManagerClientManagerAuthenticate the requesting client.
SetTokenManagerTokenManagerIssue and persist access tokens.

No AuthCodeManager or UserManager is needed — there is no authorization code step and no user to authenticate.

Registering with a server

go
srv := authkit.NewServer()
srv.RegisterGrant(flow)

See also

Released under the BSD-3-Clause License.