jwt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRefreshToken added in v1.0.3

func CreateRefreshToken(secret string, method string, token string) (string, error)

func CreateToken added in v1.0.3

func CreateToken(secret string, method string, claims jwt.MapClaims, expire int) (string, error)

func DefaultJwtLogin

func DefaultJwtLogin(path string, secret string, signingMethod string, refreshToken bool, findUser FindUserByUsernameAndPassword) routes.Route

func NewJwt

func NewJwt(env *configs.Env, signingMethod string, whitelist string) middlewares.Middleware

func NewJwtLogin

func NewJwtLogin(
	path string,
	userField string,
	passwordField string,
	secret string,
	signingMethod string,
	expire int,
	refreshToken bool,
	findUser FindUserByUsernameAndPassword,
) routes.Route

func NewJwtRefresh

func NewJwtRefresh(path string, secret string, signingMethod string, expire int) routes.Route

func ValidateRefreshToken added in v1.0.3

func ValidateRefreshToken(secret string, method string, tokenString string) (jwt.MapClaims, error)

func ValidateToken added in v1.0.3

func ValidateToken(secret string, signing string, bearerToken string) (jwt.MapClaims, error)

Types

type FindUserByUsernameAndPassword

type FindUserByUsernameAndPassword func(username string, password string) jwt.MapClaims

Jump to

Keyboard shortcuts

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