token

package
v0.0.0-...-9633304 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWK

func GenerateJWK(letterBytes string, length int) string

func JWTFromHeader

func JWTFromHeader(authHeader string, authScheme string) (string, error)

Types

type Config

type Config struct {
	JWK            []byte
	ValidSignature bool
}

func New

func New(jwk []byte, valid bool) *Config

func (*Config) Create

func (c *Config) Create(audience, issuer string, admin bool, ttl int) (string, error)

func (*Config) GetCustomClaims

func (c *Config) GetCustomClaims(tokenString string) (MyCustomClaims, error)

func (*Config) GetStandardClaims

func (c *Config) GetStandardClaims(tokenString string) (jwt.StandardClaims, error)

func (*Config) GetToken

func (c *Config) GetToken(tokenString string) (*jwt.Token, error)

type MyCustomClaims

type MyCustomClaims struct {
	Admin bool `json:"admin"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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