Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenExpired = errors.WithCode(code.ErrExpired, "Token expired") ErrTokenNotValidYet = errors.WithCode(code.ErrValidation, "Token is not active yet") ErrTokenMalformed = errors.WithCode(code.ErrTokenInvalid, "That's not even a token") ErrTokenInvalid = errors.WithCode(code.ErrTokenInvalid, "Couldn't handle this token") )
Functions ¶
This section is empty.
Types ¶
type CustomClaims ¶
type CustomClaims struct { Id int64 AuthorityId int64 jwt.StandardClaims }
CustomClaims Structured version of Claims Section, as referenced at https://tools.ietf.org/html/rfc7519#section-4.1 See examples for how to use this with your own claim types
type JWT ¶
type JWT struct {
SigningKey []byte
}
JWT signing Key
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims CustomClaims) (string, error)
CreateToken creates a new token
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error)
ParseToken parses the token.
Click to show internal directories.
Click to hide internal directories.