Documentation ¶
Index ¶
- func AccessToken(claims *v2.Claims) (*jwt.Token, string, error)
- func ExtractBearerToken(r *http.Request) string
- func GenJTI() (string, error)
- func GetClaims(token *jwt.Token) (*v2.Claims, error)
- func GetClaimsFromContext(ctx context.Context) *v2.Claims
- func InitSecret(store store.Store) error
- func NewClaims(user *v2.User) (*v2.Claims, error)
- func RefreshToken(claims *v2.Claims) (*jwt.Token, string, error)
- func SetClaimsIntoContext(r *http.Request, claims *v2.Claims) context.Context
- func ValidateExpiredToken(tokenString string) (*jwt.Token, error)
- func ValidateToken(tokenString string) (*jwt.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
AccessToken creates a new access token and returns it in both JWT and signed format, along with any error
func ExtractBearerToken ¶
ExtractBearerToken retrieves the bearer token from a request and returns the JWT
func GetClaimsFromContext ¶
GetClaimsFromContext retrieves the JWT claims from the request context
func InitSecret ¶
InitSecret initializes and retrieves the secret for our signing tokens
func RefreshToken ¶
RefreshToken returns a refresh token for a specific user
func SetClaimsIntoContext ¶
SetClaimsIntoContext adds the token claims into the request context for easier consumption later
func ValidateExpiredToken ¶
ValidateExpiredToken verifies that the provided token is valid, even if it's expired
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.