Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // DiscoveryURL is the discovery URL of the OIDC provider. If set, it // is used to discover the values of AuthEndpoint and TokenEndpoint. DiscoveryURL string // AuthEndpoint is the authorization endpoint. It must be set only if // DiscoveryURL is not set. AuthEndpoint string // Scopes is the list of scopes to request. The default list is: // openid, email. Scopes []string // TokenEndpoint is the token endpoint. It must be set only if // DiscoveryURL is not set. TokenEndpoint string // RedirectURL is the OAUTH2 redirect URL. It must be managed by the // proxy. RedirectURL string // ClientID is the Client ID. ClientID string // ClientSecret is the Client Secret. ClientSecret string }
Config contains the parameters of an OIDC provider.
type CookieManager ¶
type CookieManager interface { SetAuthTokenCookie(w http.ResponseWriter, userID, sessionID string, extraClaims map[string]string) error ClearCookies(w http.ResponseWriter) error }
type EventRecorder ¶
type EventRecorder interface {
Record(string)
}
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider handles the OIDC manual flow based on information from https://developers.google.com/identity/openid-connect/openid-connect and https://developers.facebook.com/docs/facebook-login/guides/advanced/oidc-token/
func New ¶
func New(cfg Config, er EventRecorder, cm CookieManager) (*Provider, error)
func (*Provider) HandleCallback ¶
func (p *Provider) HandleCallback(w http.ResponseWriter, req *http.Request)
func (*Provider) RequestLogin ¶
Click to show internal directories.
Click to hide internal directories.