auth

package
v0.0.0-...-68e7828 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2017 License: MIT Imports: 6 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