Documentation ¶
Overview ¶
Package authutils provides authentication utilities for apps using golang-jwt/v4
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSignedJWT ¶
GetSignedJWT creates a JWT token with the provided customClaims and returns a string signed using HMAC SHA-256
- ttl: Time To Live in minutes
- secret: Signing secret key
- customClaims
func GetTokenClaims ¶
func GetTokenClaims(token *jwt.Token) jwt.MapClaims
GetTokenClaims returns token's associated claims
func IsTokenExpiring ¶
IsTokenExpiring returns true if the provided token is expiring in the next timeLeft minutes
func ParseToken ¶
ParseToken parses and validates a signed string and returns it's token object
- signedString
- secret: Signing secret key used to generate the signedString
It always returns an error, which is nil when the parsing is successful
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.