handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ContextKeyEmail  = ContextKey("email")
	ContextKeyClaims = ContextKey("claims")
)

Context key collection

Variables

View Source
var (
	CookieDomain string
	CookieSecure bool
)

Cookies setting

Functions

func Authenticate

func Authenticate() middleware.HTTPMiddleware

Authenticate JWT Access token

func GenerateOauthStateCookie

func GenerateOauthStateCookie(expires time.Time) http.Cookie

GenerateOauthStateCookie function Generate a state token which protects us from CSRF attack This token is then must be set to browser's cookie and be validated upon callback

Types

type ContextKey

type ContextKey string

ContextKey for middleware

func (ContextKey) String

func (c ContextKey) String() string

type CredentialHandler

type CredentialHandler interface {
	Register() middleware.HTTPMiddleware
	Login() middleware.HTTPMiddleware
	Logout() middleware.HTTPMiddleware
	SetClaims() middleware.HTTPMiddleware
	Callback() middleware.HTTPMiddleware
}

CredentialHandler interface to handle credential

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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