Documentation
¶
Index ¶
Constants ¶
View Source
const ( SelfIssuedTokenSubJwkClaimName string = "sub_jwk" SelfIssuedIssScheme string = "agntcy" )
Variables ¶
This section is empty.
Functions ¶
func ParseCommonName ¶ added in v0.0.21
Types ¶
type Authenticator ¶
type Authenticator interface {
Token(
ctx context.Context,
issuer string,
clientID string,
clientSecret string,
options ...AuthenticatorTokenOption,
) (string, error)
}
func NewAuthenticator ¶
func NewAuthenticator() Authenticator
type AuthenticatorTokenOption ¶ added in v0.0.22
type AuthenticatorTokenOption func(config *clientcredentials.Config)
func WithScopes ¶ added in v0.0.22
func WithScopes(scopes []string) AuthenticatorTokenOption
type CachedJwks ¶
type CachedJwks struct {
Jwks string
}
type ParsedJWT ¶
type ParsedJWT struct {
Claims *Claims
Provider ProviderName
CommonName string
// contains filtered or unexported fields
}
type Parser ¶
type Parser interface {
// VerifyJwt verifies the provided JWT signature.
// If the JWT is not self-issued (provider = SelfProviderName) it will validate
// the token using the public key located in the claims (sub_jwk).
// Else, it will attempt to retrieve the JWKS from the issuer's metadata.
VerifyJwt(ctx context.Context, jwt *ParsedJWT) error
// Get the parsed JWT including the issuer, the subject claims
// the common name and the provider metadata
ParseJwt(ctx context.Context, jwtString *string) (*ParsedJWT, error)
}
The Parser defines different methods for the PARSER standard
type ProviderName ¶
type ProviderName int
const ( UnknownProviderName ProviderName = iota OktaProviderName DuoProviderName OryProviderName IdpProviderName PingProviderName EntraProviderName SelfProviderName )
Click to show internal directories.
Click to hide internal directories.