Versions in this module Expand all Collapse all v0 v0.2.0 Oct 25, 2026 v0.1.0 Oct 18, 2026 Changes in this version + const CredentialKindBearer + const CredentialKindJWT + var ErrExpired = errors.New("authentication: expired") + var ErrInvalidCallback = errors.New("authentication: invalid callback") + var ErrInvalidCredential = errors.New("authentication: invalid credential") + var ErrInvalidPrincipal = errors.New("authentication: invalid principal") + var ErrProviderNotFound = errors.New("authentication: provider not found") + var ErrReplay = errors.New("authentication: replay detected") + var ErrUnauthenticated = errors.New("authentication: unauthenticated") + var ErrUnsupportedCredential = errors.New("authentication: unsupported credential") + func ContextWithPrincipal(ctx context.Context, principal Principal) context.Context + func ValidatePrincipal(principal Principal, now time.Time) error + type Authenticator interface + Authenticate func(context.Context, Credential) (Principal, error) + func Chain(authenticators ...Authenticator) Authenticator + type BeginRequest struct + LoginHint string + Provider string + RedirectURI string + Scopes []string + func (r BeginRequest) Clone() BeginRequest + type Callback struct + Code string + RelayState string + SAMLResponse string + StateID string + type Credential struct + Attributes map[string]string + Kind string + Token []byte + func (c Credential) Clone() Credential + type FederatedProvider interface + Begin func(context.Context, BeginRequest) (Redirect, error) + Complete func(context.Context, Callback) (Principal, error) + Name func() string + type Principal struct + AuthenticatedAt time.Time + ExpiresAt time.Time + ID string + Issuer string + Methods []string + Subject string + Traits map[string][]string + func PrincipalFromContext(ctx context.Context) (Principal, bool) + func (p Principal) Clone() Principal + type Redirect struct + ExpiresAt time.Time + StateID string + URL *url.URL + func (r Redirect) Clone() Redirect