Documentation ¶
Index ¶
- func CheckValidationError(err error, flag uint32) bool
- func GenerateToken(method jwt.SigningMethod, claims jwt.Claims, key interface{}) (string, error)
- func GenerateTokenWithHS256(claims jwt.Claims, secret []byte) (string, error)
- func GenerateTokenWithHS384(claims jwt.Claims, secret []byte) (string, error)
- func GenerateTokenWithHS512(claims jwt.Claims, secret []byte) (string, error)
- func IsAudienceError(err error) bool
- func IsClaimsInvalidError(err error) bool
- func IsExpiredError(err error) bool
- func IsIdError(err error) bool
- func IsIssuedAtError(err error) bool
- func IsIssuerError(err error) bool
- func IsNotValidYetError(err error) bool
- func IsTokenInvalidError(err error) bool
- func ParseToken(signedToken string, secret []byte, claims jwt.Claims) (*jwt.Token, error)
- func ParseTokenClaims(signedToken string, secret []byte, claims jwt.Claims) (jwt.Claims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckValidationError ¶ added in v1.5.0
CheckValidationError returns true if given error is jwt.ValidationError with given flag.
func GenerateToken ¶
GenerateToken generates token using given jwt.Claims, secret and jwt.SigningMethod.
func GenerateTokenWithHS256 ¶ added in v1.5.0
GenerateTokenWithHS256 generates token using given jwt.Claims, secret and HS256 (HMAC SHA256) signing method.
func GenerateTokenWithHS384 ¶ added in v1.5.0
GenerateTokenWithHS384 generates token using given jwt.Claims, secret and HS384 (HMAC SHA384) signing method.
func GenerateTokenWithHS512 ¶ added in v1.5.0
GenerateTokenWithHS512 generates token using given jwt.Claims, secret and HS512 (HMAC SHA512) signing method.
func IsAudienceError ¶ added in v1.5.0
IsAudienceError checks error is an AUD (Audience) validation error.
func IsClaimsInvalidError ¶ added in v1.5.0
IsClaimsInvalidError checks error is a generic claims validation error.
func IsExpiredError ¶ added in v1.5.0
IsExpiredError checks error is an EXP (Expires at) validation error.
func IsIssuedAtError ¶ added in v1.5.0
IsIssuedAtError checks error is an IAT (Issued at) validation error.
func IsIssuerError ¶ added in v1.5.0
IsIssuerError checks error is an ISS (Issuer) validation error.
func IsNotValidYetError ¶ added in v1.5.0
IsNotValidYetError checks error is a NBF (Not before) validation error.
func IsTokenInvalidError ¶ added in v1.5.0
IsTokenInvalidError checks error is an invalid token (could not be parsed) error.
func ParseToken ¶
ParseToken parses jwt token string using given custom jwt.Claims and returns jwt.Token.
func ParseTokenClaims ¶ added in v1.5.0
ParseTokenClaims parses jwt token string using given custom jwt.Claims and returns jwt.Claims.
Types ¶
This section is empty.