Documentation ¶
Index ¶
- Variables
- type JWT
- func (j *JWT) CreateToken(claim jwt.Claims) (string, error)
- func (j *JWT) CreateTokenHash(method jwt.SigningMethod, claim jwt.Claims) (string, error)
- func (j *JWT) NewBasicClaim(start time.Time) jwt.RegisteredClaims
- func (j *JWT) ParseToken(claim jwt.Claims, tokenString string, options ...jwt.ParserOption) (jwt.Claims, error)
- func (j *JWT) ParseTokenWithoutClaimsValidation(claim jwt.Claims, tokenString string) (jwt.Claims, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type JWT ¶
JWT Life for second
func NewJWTString ¶
func (*JWT) CreateToken ¶
CreateToken 创建一个token
func (*JWT) CreateTokenHash ¶
func (*JWT) NewBasicClaim ¶
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(claim jwt.Claims, tokenString string, options ...jwt.ParserOption) (jwt.Claims, error)
ParseToken 解析token
ErrInvalidKey = errors.New("key is invalid") ErrInvalidKeyType = errors.New("key is of invalid type") ErrHashUnavailable = errors.New("the requested hash function is unavailable") ErrTokenMalformed = errors.New("token is malformed") ErrTokenUnverifiable = errors.New("token is unverifiable") ErrTokenSignatureInvalid = errors.New("token signature is invalid") ErrTokenInvalidAudience = errors.New("token has invalid audience") ErrTokenExpired = errors.New("token is expired") ErrTokenUsedBeforeIssued = errors.New("token used before issued") ErrTokenInvalidIssuer = errors.New("token has invalid issuer") ErrTokenNotValidYet = errors.New("token is not valid yet") ErrTokenInvalidId = errors.New("token has invalid id") ErrTokenInvalidClaims = errors.New("token has invalid claims")
无法辨认的错误默认TokenInvalid
func (*JWT) ParseTokenWithoutClaimsValidation ¶
Click to show internal directories.
Click to hide internal directories.