jwt

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 16 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 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 ValidateUserToken

func ValidateUserToken(token string, scope string, audiences ...string) (*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