caddyoidc

package module
v0.0.0-...-8537e3e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 25 Imported by: 0

README

caddy-oidc

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnableToGetProviderConfig = errors.New("Unable to get provider config")

Functions

This section is empty.

Types

type App

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

func (App) CaddyModule

func (App) CaddyModule() caddy.ModuleInfo

func (*App) GetSession

func (app *App) GetSession(r *http.Request) (*Session, *Provider)

func (*App) Provision

func (app *App) Provision(ctx caddy.Context) error

func (*App) RegisterProvider

func (app *App) RegisterProvider(provider *Provider) string

func (*App) Start

func (app *App) Start() error

func (*App) Stop

func (app *App) Stop() error

type Endpoints

type Endpoints struct {
	Authorization string `json:"authorization_endpoint"`
	Token         string `json:"token_endpoint"`
	UserInfo      string `json:"userinfo_endpoint"`
	Revocation    string `json:"revocation_endpoint"`
	EndSession    string `json:"end_session_endpoint"` // post_logout_redirect_uri
}

type HasIdentity

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

func (HasIdentity) CaddyModule

func (HasIdentity) CaddyModule() caddy.ModuleInfo

func (*HasIdentity) Match

func (hasIdentity *HasIdentity) Match(r *http.Request) bool

func (*HasIdentity) Provision

func (hasIdentity *HasIdentity) Provision(ctx caddy.Context) error

func (*HasIdentity) UnmarshalCaddyfile

func (hasIdentity *HasIdentity) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

func (*HasIdentity) Validate

func (hasIdentity *HasIdentity) Validate() error

type Provider

type Provider struct {
	*oidc.Provider

	ClientID            string    `json:"client_id"`
	ClientSecret        string    `json:"client_secret"`
	Scopes              []string  `json:"scopes"`
	Endpoints           Endpoints `json:"endpoints"`
	OAuthValidateURL    string    `json:"oauth_validate_url"`
	URL                 string    `json:"provider"`
	CookiePath          string    `json:"cookie_path"`
	CookieNameKey       string    `json:"cookie_name_key"`
	CookieNameProvider  string    `json:"cookie_name_provider"`
	CookieNameState     string    `json:"cookie_name_state"`
	CookieNameRedirect  string    `json:"cookie_name_redirect"`
	DebugPath           string    `json:"debug_path"`
	LoginPath           string    `json:"login_path"`
	LogoutPath          string    `json:"logout_path"`
	CallbackPath        string    `json:"callback_path"`
	LogoutRedirect      string    `json:"logout_redirect"`
	DefaultRoot         string    `json:"default_root"`
	LazyLoad            bool      `json:"lazy_load"`
	Debug               bool      `json:"debug"`
	UserInfo            bool      `json:"user_info"`
	RemoteConfigTimeout string    `json:"remote_config_timeout"`
	// contains filtered or unexported fields
}

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

func (*Provider) Callback

func (provider *Provider) Callback(w http.ResponseWriter, r *http.Request) error

func (*Provider) DeleteSession

func (provider *Provider) DeleteSession(session *Session)

func (*Provider) DumpSession

func (provider *Provider) DumpSession(w http.ResponseWriter, r *http.Request) error

func (*Provider) GetSession

func (provider *Provider) GetSession(r *http.Request) *Session

func (*Provider) LoadRemoteConfig

func (provider *Provider) LoadRemoteConfig() error

func (*Provider) Login

func (provider *Provider) Login(w http.ResponseWriter, r *http.Request) error

func (*Provider) Logout

func (provider *Provider) Logout(w http.ResponseWriter, r *http.Request) error

func (*Provider) Provision

func (provider *Provider) Provision(ctx caddy.Context) error

func (*Provider) RandString

func (provider *Provider) RandString() string

func (*Provider) RefreshUserInfo

func (provider *Provider) RefreshUserInfo(session *Session) error

func (*Provider) RegisterSession

func (provider *Provider) RegisterSession(r *http.Request, token *oauth2.Token) (string, *Session, error)

func (*Provider) ServeHTTP

func (provider *Provider) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

func (*Provider) Sign

func (provider *Provider) Sign(r *http.Request) ([]byte, error)

func (*Provider) UnmarshalCaddyfile

func (provider *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

func (*Provider) Validate

func (provider *Provider) Validate() error

func (*Provider) Values

func (provider *Provider) Values() map[string]interface{}

type Session

type Session struct {
	Sign     []byte                 `json:"sign"`
	Token    *oauth2.Token          `json:"token"`
	UserInfo map[string]interface{} `json:"user_info"`
	Claims   map[string]interface{} `json:"claims"`
}

func (*Session) Values

func (s *Session) Values() map[string]interface{}

Jump to

Keyboard shortcuts

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