oauth2

package
v0.0.0-...-a647d32 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthenticationFailed = errors.New("authentication failed")
)

Functions

func DefaultUserProvider

func DefaultUserProvider(_ *oauth2.Token) (security.User, error)

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(options ...AuthenticatorOption) *Authenticator

func (Authenticator) Authenticate

func (a Authenticator) Authenticate(_ context.Context, t security.Token) (authenticatedToken security.Token, err error)

func (*Authenticator) Support

func (a *Authenticator) Support(_ context.Context, t security.Token) bool

type AuthenticatorOption

type AuthenticatorOption func(*Authenticator)

AuthOption defines a interceptor middleware configuration option

func WithUserProvider

func WithUserProvider(getter UserProvider) AuthenticatorOption

type UserProvider

type UserProvider func(oauth2Token *oauth2.Token) (security.User, error)

Jump to

Keyboard shortcuts

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