Documentation ¶
Overview ¶
package x uses golang.org/x/oauth2 to implement a Provider for the OAuth2 flow.
Index ¶
- type OAuth2
- func (o *OAuth2) AuthCodeURL(state string) (string, string, error)
- func (o *OAuth2) Exchange(code, verifier string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)
- func (o *OAuth2) Refresh(refreshToken string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)
- func (o *OAuth2) SetRedirectURL(url string)
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(code, verifier 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.
Click to show internal directories.
Click to hide internal directories.