Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTokenString ¶
func GetTokenString(getHeaderFn oidc.GetHeaderFn, tokenStringOpts [][]options.TokenStringOption) (string, error)
GetTokenString takes a GetHeaderFn `func(key string) string` and [][]options.TokenStringOption and returns the token as an string or an error.
Types ¶
type TokenHandler ¶
type TokenHandler[T any] struct { // contains filtered or unexported fields }
TokenHandler is used to parse tokens.
func New ¶
func New[T any](claimsValidationFn options.ClaimsValidationFn[T], setters ...options.Option) (*TokenHandler[T], error)
New returns an OpenID Connect (OIDC) discovery token handler. Can be used to create your own middleware.
func (*TokenHandler[T]) ParseToken ¶
func (t *TokenHandler[T]) ParseToken(ctx context.Context, tokenString string) (T, error)
ParseToken takes a context and a string and returns a jwt.Token or an error. jwt.Token is from `github.com/lestrrat-go/jwx/jwt`.
Click to show internal directories.
Click to hide internal directories.