auth

package
v0.4.23 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 80 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenIDConnectKey = "openid_connect"
)
View Source
const WebAuthKey = "auth"

Variables

View Source
var (
	AvailableProviderNames map[string]string
	AvailableProviderKeys  []string
)

Functions

func BeginAuthHandler

func BeginAuthHandler(prv *Provider, w http.ResponseWriter, r *http.Request, websess util.ValueMap, logger util.Logger) (string, error)

func CompleteUserAuth

func CompleteUserAuth(
	prv *Provider, w http.ResponseWriter, r *http.Request, websess util.ValueMap, logger util.Logger,
) (string, *user.Account, user.Accounts, error)

func GothURL added in v0.4.11

func GothURL(key string, proto string, host string, redirPathOverride ...string) string

func Logout

func Logout(w http.ResponseWriter, r *http.Request, websess util.ValueMap, logger util.Logger, prvKeys ...string) error

func ProviderUsage

func ProviderUsage(id string, enabled bool) string

Types

type Provider

type Provider struct {
	ID     string   `json:"id"`
	Title  string   `json:"title"`
	Key    string   `json:"-"`
	Secret string   `json:"-"`
	Scopes []string `json:"-"`
}

func (*Provider) Goth

func (p *Provider) Goth(proto string, host string, redirPathOverride ...string) (goth.Provider, error)

type Providers

type Providers []*Provider

func (Providers) Contains

func (p Providers) Contains(id string) bool

func (Providers) Get

func (p Providers) Get(id string) *Provider

func (Providers) IDs

func (p Providers) IDs() []string

func (Providers) Titles

func (p Providers) Titles() []string

type Service

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

func NewService

func NewService(baseURL string, port uint16, logger util.Logger) *Service

func (*Service) LoginURL

func (s *Service) LoginURL() string

func (*Service) Providers

func (s *Service) Providers(logger util.Logger) (Providers, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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