jwt

package
v0.0.0-...-fb80ee1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	PrivateKey string
}

AuthService is a mailspree.AuthService based on jwt.

func (AuthService) Authenticate

func (as AuthService) Authenticate(u mailspree.User, password string) (string, error)

Authenticate takes a user and password, if they match, a jwt is returned. If not an error is returned.

func (AuthService) Validate

func (as AuthService) Validate(tokenStr string, us mailspree.UserService) (mailspree.User, error)

Validate takes a jwt token string and validates it. If it passes validation, user is fetched and returned from the user service

Jump to

Keyboard shortcuts

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