jwt

package module
v2.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingBearerToken       = errors.Unauthorized(engine.Reason, "missing bearer token")
	ErrMissingKeyFunc           = errors.Unauthorized(engine.Reason, "missing key func")
	ErrUnauthenticated          = errors.Unauthorized(engine.Reason, "unauthenticated")
	ErrInvalidToken             = errors.Unauthorized(engine.Reason, "invalid token")
	ErrTokenExpired             = errors.Unauthorized(engine.Reason, "token expired")
	ErrUnsupportedSigningMethod = errors.Unauthorized(engine.Reason, "unsupported signing method")
	ErrInvalidClaims            = errors.Unauthorized(engine.Reason, "invalid claims")
	ErrInvalidSubject           = errors.Unauthorized(engine.Reason, "invalid subject")
	ErrGetKeyFailed             = errors.Unauthorized(engine.Reason, "get key failed")
	ErrSignTokenFailed          = errors.Unauthorized(engine.Reason, "sign token failed")
)

Functions

func NewAuthenticator

func NewAuthenticator(opts ...Option) (engine.Authenticator, error)

NewAuthenticator creates a new authenticator with custom options

Types

type Claims

type Claims struct {
	Subject string
	Scopes  ScopeSet
}

Claims contains claims that are included in OIDC standard claims. See https://openid.net/specs/openid-connect-core-1_0.html#IDToken

func (*Claims) GetScopes

func (c *Claims) GetScopes() ScopeSet

GetScopes returns the scopes object

func (*Claims) GetSubject

func (c *Claims) GetSubject() string

GetSubject returns a subject string

type Option

type Option func(*options)

Option is jwt option

func WithKey

func WithKey(key []byte) Option

WithKey set key

func WithSigningMethod

func WithSigningMethod(alg string) Option

WithSigningMethod set signing method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL