jwt

package
v0.0.0-...-fa7c36c Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRequest

func FromRequest(r *http.Request) string

FromRequest reads the given http request to see if it contains a JWT.

func Get

func Get(iss string, sub string, secret string, nbf time.Time, exp time.Duration) string

Get takes in init values and returns a signed HS256 JWT as a string.

Types

type MapClaims

type MapClaims jwt.MapClaims

MapClaims represents the json data of this JWT

func Verify

func Verify(token string, secret string) (MapClaims, error)

Verify takes in a JWT string an a corresponding HS256 secret and verifies the token and its claims are valid.

func VerifyRequest

func VerifyRequest(r *http.Request, secret string) (MapClaims, error)

VerifyRequest is a shortcut for `Verify(FromRequest(r), secret)`

Jump to

Keyboard shortcuts

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