Documentation ¶
Index ¶
- func RequireTokenAuthentication(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- type JWTAuthenticationBackend
- func (backend *JWTAuthenticationBackend) Authenticate(user *models.User) bool
- func (backend *JWTAuthenticationBackend) GenerateToken(idUser int) (string, error)
- func (backend *JWTAuthenticationBackend) IsInBlacklist(token string) bool
- func (backend *JWTAuthenticationBackend) Logout(tokenString string, token *jwt.Token) error
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
Click to show internal directories.
Click to hide internal directories.