Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OAuth2 ¶
type OAuth2 struct { Config *oauth2.Config UserInfoEndpoint string HTTPClient *http.Client // will use http.DefaultClient if let nil }
OAuth2 implements a Provider for the OAuth2 flow.
func (*OAuth2) AuthCodeURL ¶
AuthCodeURL returns the Auth-URL to redirect the user to
func (*OAuth2) Exchange ¶
func (o *OAuth2) Exchange(_state, code string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)
Exchange exchanges the code and provides a way to unmarshal the user info
func (*OAuth2) SetRedirectURL ¶
SetRedirectURL sets the local callback URL.
type Provider ¶
type Provider interface { // SetRedirectURL sets the local callback URL. SetRedirectURL(url string) // AuthCodeURL returns the Provider URL to redirect the user to. AuthCodeURL(state string) (string, error) // Exchange exchanges the code and provides a way to unmarshal the user info. // state might be useful to link to the previous call of AuthCodeURL, // but its the caller responsibility to check its value for CSRF protection. // // var user struct { // ID string `json:"sub"` // Email string `json:"email"` // Name string `json:"name"` // } // err = unmarshalUser(&user) Exchange(state, code string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error) }
Provider is an interface suitable for OAuth2 and OIDC flows.
Directories ¶
Path | Synopsis |
---|---|
package caos is a WIP (not working yet) to provides a Provider for OpenID Connect (oidc), backed by the github.com/caos/oidc module.
|
package caos is a WIP (not working yet) to provides a Provider for OpenID Connect (oidc), backed by the github.com/caos/oidc module. |
package coreos provides a Provider for OpenID Connect (oidc), backed by the github.com/coreos/go-oidc module.
|
package coreos provides a Provider for OpenID Connect (oidc), backed by the github.com/coreos/go-oidc module. |
package goauthboss provides an Init method to integrate with authboss.
|
package goauthboss provides an Init method to integrate with authboss. |
Click to show internal directories.
Click to hide internal directories.