auth

package
v0.0.0-...-07785dc Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtMiddleware = jwtmiddleware.New(jwtmiddleware.Options{
	ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
		return signingKey, nil
	},
	UserProperty:  "user",
	Debug:         false,
	SigningMethod: jwt.SigningMethodHS256,
})

JwtMiddleware handler for jwt tokens

Functions

func GetJSONToken

func GetJSONToken(user *models.User) string

GetJSONToken create a JSON token string

func GetToken

func GetToken(user *models.User) string

GetToken create a jwt token with user claims

func GetUserClaimsFromContext

func GetUserClaimsFromContext(req *http.Request) map[string]interface{}

GetUserClaimsFromContext return "user" claims as a map from request

Types

This section is empty.

Jump to

Keyboard shortcuts

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