jwt

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenStore

type TokenStore struct {
	// contains filtered or unexported fields
}

TokenStore implements a stateless TokenStore using JWTs

func New

func New(key []byte, iss string, aud []string, dur time.Duration) *TokenStore

New returns a new JWT TokenStore. key should be 256 bits. If iss and aud are set, they will be put in the token and verified by Authenticate. dur is used to set the iat, nbf, and exp claims

func (*TokenStore) Authenticate

func (t *TokenStore) Authenticate(token string) (identifier string, err error)

Authenticate authenticates the token and returns the associated identifier.

func (*TokenStore) New

func (t *TokenStore) New(identifier string) (token string, err error)

New generates a new token for identifier

Jump to

Keyboard shortcuts

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