authnHandler

package
v0.0.0-...-045fd93 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthNHandler

func NewAuthNHandler(handler http.Handler, openIDConfig OpenIDConfig, sharedSecrets []string) http.Handler

Types

type AuthInfo

type AuthInfo struct {
	Username   string   `json:"username,omitempty"`
	Issuer     string   `json:"iss,omitempty"`
	Subject    string   `json:"sub,omitempty"`
	Audience   []string `json:"aud,omitempty"`
	Expiration int64    `json:"exp,omitempty"`
	NotBefore  int64    `json:"nbf,omitempty"`
}

type AuthNHandler

type AuthNHandler struct {
	SharedSecrets []string
	// contains filtered or unexported fields
}

func (*AuthNHandler) GenValidAuthCookie

func (h *AuthNHandler) GenValidAuthCookie(username string) (*http.Cookie, error)

Generates a valid auth cookie that can be used by clients, should only be used by users of the lib in their test functions

func (*AuthNHandler) JWTClaims

func (h *AuthNHandler) JWTClaims(t *jwt.JSONWebToken, dest ...interface{}) (err error)

Next are the functions fo checking the callback

func (*AuthNHandler) ServeHTTP

func (h *AuthNHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OpenIDConfig

type OpenIDConfig struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
	ProviderURL  string `yaml:"provider_url"`
	AuthURL      string `yaml:"auth_url"`
	TokenURL     string `yaml:"token_url"`
	UserinfoURL  string `yaml:"userinfo_url"`
	Scopes       string `yaml:"scopes"`
}

Jump to

Keyboard shortcuts

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