jwt

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName = "jwt"
)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(username, hashedPassword string) (string, error)

Types

type TokenAuthenticator

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

func (*TokenAuthenticator) AuthenticateToken

func (a *TokenAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authentication.Response, bool, error)

type TokenGenerator

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

func NewTokenGenerator

func NewTokenGenerator(ttl, privateKey, signMethod string) (*TokenGenerator, error)

func (*TokenGenerator) GenerateToken

func (t *TokenGenerator) GenerateToken(ctx context.Context, username string, password string) (string, error)

Jump to

Keyboard shortcuts

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