cbwebauth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.3.0

type Config struct {
	Providers               []Provider
	UnauthorisedRedirectUri string
	LogoutRedirectUri       string
}

type Container

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

func New

func New(config Config) *Container

func (*Container) AuthMiddleware

func (c *Container) AuthMiddleware(ctx *fasthttp.RequestCtx) (bool, error)

func (*Container) GetUniqueIdentifier

func (c *Container) GetUniqueIdentifier(providerName string, ctx *fasthttp.RequestCtx) (string, error)

func (*Container) IsAuthenticated

func (c *Container) IsAuthenticated(providerName string, ctx *fasthttp.RequestCtx) (bool, error)

func (*Container) Login

func (c *Container) Login(providerName string, ctx *fasthttp.RequestCtx) (bool, error, []error)

func (*Container) Logout

func (c *Container) Logout(providerName string, ctx *fasthttp.RequestCtx) (bool, error)

func (*Container) Register

func (c *Container) Register(providerName string, ctx *fasthttp.RequestCtx) (bool, error, []error)

type Provider

type Provider interface {
	GetProviderName() string
	GetUniqueIdentifier(ctx *fasthttp.RequestCtx) string
	IsAuthenticated(ctx *fasthttp.RequestCtx) bool
	Login(ctx *fasthttp.RequestCtx) (bool, []error)
	Logout(ctx *fasthttp.RequestCtx) bool
	Register(ctx *fasthttp.RequestCtx) (bool, []error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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