auth

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SESSIONNAME = "promacl-auth"

SESSIONNAME is the gorilla/sessions name

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	LoginHandler(w http.ResponseWriter, r *http.Request)
	CallbackHandler(w http.ResponseWriter, r *http.Request)
	Middleware(next http.Handler) http.Handler
}

Auth provides all methods neded for an auth provider

func NewAuth

func NewAuth(cfg *config.Config, authPath string) (a Auth, err error)

NewAuth create a new instance of the configured AuthProvider

type OidcAuth

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

OidcAuth provides middleware and oauth handlers for authentification

func NewOauthAuth

func NewOauthAuth(cfg *config.Config, authPath string) (a *OidcAuth, err error)

NewOauthAuth creates a new Auth

func (OidcAuth) CallbackHandler

func (a OidcAuth) CallbackHandler(w http.ResponseWriter, r *http.Request)

CallbackHandler is the HTTP route for callback

func (OidcAuth) LoginHandler

func (a OidcAuth) LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler is the HTTP route for the login

func (OidcAuth) Middleware

func (a OidcAuth) Middleware(next http.Handler) http.Handler

Middleware verifies the token and redirects to login

Jump to

Keyboard shortcuts

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