jwt

package
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package jwt provides the needed functions to generate tokens for users

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDefaultUserToken

func GenerateDefaultUserToken(user models.User) (*models.UserToken, error)

GenerateDefaultUserToken generates a jwt user token with the default audiences in the context It returns a user token object and an error if it exists

func GenerateRecoverToken added in v0.0.6

func GenerateRecoverToken(keyId string, user models.User) string

func GenerateRefreshToken

func GenerateRefreshToken(keyId string, user models.User) (string, error)

GenerateRefreshToken generates a refresh token for the user with a

func GenerateUserToken

func GenerateUserToken(keyId string, user models.User) (*models.UserToken, error)

GenerateUserToken

func GenerateUserTokenForAudiences

func GenerateUserTokenForAudiences(keyId string, user models.User, audiences ...string) (*models.UserToken, error)

func GenerateUserTokenForKeyAndAudiences

func GenerateUserTokenForKeyAndAudiences(keyId string, user models.User, audiences ...string) (*models.UserToken, error)

func GenerateVerifyEmailToken

func GenerateVerifyEmailToken(keyId string, user models.User) string

func GetTokenClaim

func GetTokenClaim(token string, claim string) string

func ValidateRefreshToken

func ValidateRefreshToken(token string, user string) (*models.UserToken, error)

func ValidateTokenByScope added in v0.0.6

func ValidateTokenByScope(token string, userId string, scope string) (*models.UserToken, error)

func ValidateUserToken

func ValidateUserToken(token string, authorizationContext *authorization_context.AuthorizationContext) (*models.UserToken, error)

Types

type RawCertificateHeader

type RawCertificateHeader struct {
	Algorithm string `json:"alg,omitempty"`
	KeyId     string `json:"kid,omitempty"`
	X5T       string `json:"x5t,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL