authentication

package
v0.0.0-...-3444f4f Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireTokenAuthentication

func RequireTokenAuthentication(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc)

Types

type JWTAuthenticationBackend

type JWTAuthenticationBackend struct {
	PublicKey *rsa.PublicKey
	// contains filtered or unexported fields
}

func InitJWTAuthenticationBackend

func InitJWTAuthenticationBackend() *JWTAuthenticationBackend

func (*JWTAuthenticationBackend) Authenticate

func (backend *JWTAuthenticationBackend) Authenticate(user *models.User) bool

func (*JWTAuthenticationBackend) GenerateToken

func (backend *JWTAuthenticationBackend) GenerateToken(idUser int) (string, error)

func (*JWTAuthenticationBackend) IsInBlacklist

func (backend *JWTAuthenticationBackend) IsInBlacklist(token string) bool

func (*JWTAuthenticationBackend) Logout

func (backend *JWTAuthenticationBackend) Logout(tokenString string, token *jwt.Token) error

Jump to

Keyboard shortcuts

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