Documentation
¶
Index ¶
- Constants
- func AccessTokenFromContext(ctx context.Context) string
- func ContextWithAccessToken(ctx context.Context, token string) context.Context
- func NewContextWithOIDCUserInfo(ctx context.Context, userInfo *goth.User) context.Context
- func OIDCUserInfoFromContext(ctx context.Context) *goth.User
- type Config
- type Handler
- func (h *Handler) AuthRequest(r *http.Request) (stdctx.Context, error)
- func (h *Handler) AuthStart() http.HandlerFunc
- func (h *Handler) AuthWrapper(next http.HandlerFunc) http.HandlerFunc
- func (h *Handler) Callback() http.HandlerFunc
- func (h *Handler) LogoutHandler() http.HandlerFunc
- func (h *Handler) Middleware(next http.Handler) http.Handler
- type ProviderConfig
- type ProviderMap
- type SessionData
Constants ¶
View Source
const ( SessionCookieName = "dioad_session" PreAuthRefererCookieName = "auth_referer" )
Variables ¶
This section is empty.
Functions ¶
func AccessTokenFromContext ¶ added in v0.52.0
func ContextWithAccessToken ¶ added in v0.52.0
Types ¶
type Config ¶
type Config struct {
ProviderMap ProviderMap `mapstructure:"providers"`
CookieConfig http.CookieConfig `mapstructure:"cookies"`
}
type Handler ¶
type Handler struct {
CookieStore sessions.Store
LoginPath string
LogoutPath string
CallbackDefaultRedirect string
HomePath string
}
func (*Handler) AuthRequest ¶ added in v0.37.0
func (*Handler) AuthStart ¶
func (h *Handler) AuthStart() http.HandlerFunc
func (*Handler) AuthWrapper ¶
func (h *Handler) AuthWrapper(next http.HandlerFunc) http.HandlerFunc
func (*Handler) Callback ¶
func (h *Handler) Callback() http.HandlerFunc
func (*Handler) LogoutHandler ¶
func (h *Handler) LogoutHandler() http.HandlerFunc
type ProviderConfig ¶
type ProviderConfig struct {
ClientID string `mapstructure:"client-id"`
ClientSecret string `mapstructure:"client-secret"`
Callback string `mapstructure:"callback"`
Scopes []string `mapstructure:"scopes"` // OAuth2 Scopes - Optional
DiscoveryURL string `mapstructure:"discovery-url"` // OpenID Connect Discovery URL - Optional
}
type ProviderMap ¶
type ProviderMap map[string]ProviderConfig
Click to show internal directories.
Click to hide internal directories.