Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKIDNotFound = keyfunc.ErrKIDNotFound
Functions ¶
func GetOptionJWK ¶
func GetOptionJWK(opts ...OptionJWK) optionsJWK
func MapOptionKeyfunc ¶
func MultiJWTKeyFunc ¶
func MultiJWTKeyFunc(providers []InfProvider, opts ...OptionJWK) (models.InfKeyFunc, error)
MultiJWTKeyFunc returns a jwt.Keyfunc with multiple keyfunc.
Doesn't support introspect and noops, it will ignore them.
Types ¶
type InfProvider ¶
type KeyFuncMulti ¶
type KeyFuncMulti struct {
// contains filtered or unexported fields
}
func (*KeyFuncMulti) KeySelectorFirst ¶
func (k *KeyFuncMulti) KeySelectorFirst(multiJWKS *keyfunc.MultipleJWKS, token *jwt.Token) (interface{}, error)
type KeyFuncParser ¶
func (*KeyFuncParser) Keyfunc ¶
func (j *KeyFuncParser) Keyfunc(token *jwt.Token) (interface{}, error)
func (*KeyFuncParser) ParseWithClaims ¶
type OptionJWK ¶
type OptionJWK func(options *optionsJWK)
func WithClient ¶
WithClient is used to set the http.Client used to fetch the JWKs.
func WithContext ¶
WithContext is used to set the context used to fetch the JWKs.
func WithIntrospect ¶
func WithKeyFunc ¶
func WithKeyFunc(keyFunc models.InfKeyFunc) OptionJWK
WithGivenKeys is used to set the given keys used to verify the token.
Return ErrKIDNotFound if the kid is not found.
Example:
// Create the JWKS from the given keys.
givenKeys := map[string]keyfunc.GivenKey{
"my-key-id": keyfunc.NewGivenHMAC(...),
}
jwks := keyfunc.NewGiven(givenKeys)
func WithRefreshErrorHandler ¶
WithRefreshErrorHandler sets the refresh error handler for the jwt.Key.
func WithRefreshInterval ¶
WithRefreshInterval sets the refresh interval for the jwt.Keyfunc default is 5 minutes.
Click to show internal directories.
Click to hide internal directories.