Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenInvalid = errors.Unauthorized(reason, "Token is invalid") ErrTokenExpired = errors.Unauthorized(reason, "Token has expired") ErrTokenParseFailed = errors.Unauthorized(reason, "Failed to parse token") ErrSigningMethod = errors.Unauthorized(reason, "Wrong signing method") ErrSignTokenFailed = errors.Unauthorized(reason, "Failed to sign token") )
View Source
var ( MessageTokenInvalid = &i18n.Message{ID: "jwt.token.invalid", Other: ErrTokenInvalid.Error()} MessageTokenExpired = &i18n.Message{ID: "jwt.token.expired", Other: ErrTokenExpired.Error()} MessageTokenParseFailed = &i18n.Message{ID: "jwt.token.parse.failed", Other: ErrTokenParseFailed.Error()} MessageSigningMethod = &i18n.Message{ID: "jwt.wrong.signing.method", Other: ErrSigningMethod.Error()} MessageSignTokenFailed = &i18n.Message{ID: "jwt.token.sign.failed", Other: ErrSignTokenFailed.Error()} )
Functions ¶
This section is empty.
Types ¶
type JWTAuth ¶
type JWTAuth struct {
// contains filtered or unexported fields
}
func (*JWTAuth) ParseClaims ¶
type Option ¶
type Option func(*options)
func WithExpired ¶
func WithIssuer ¶
func WithKeyFunc ¶
func WithKeyFunc(keyFunc jwt.Keyfunc) Option
func WithSigningKey ¶
func WithSigningMethod ¶
func WithSigningMethod(method jwt.SigningMethod) Option
func WithTokenHeader ¶
Click to show internal directories.
Click to hide internal directories.