Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Router *router.Module HandleError func(http.ResponseWriter, *http.Request, error) error // contains filtered or unexported fields }
Module oauth implements oauth start and callback
func (*Module) AddProvider ¶
AddProvider adds a new provider to the oauth module. Provider are registered during the Start phase.
type Provider ¶
type Provider struct { // required Base string Config *oauth2.Config PostCallback RedirectCallbackFn // optional Options []oauth2.AuthCodeOption SetOAuthState func(*http.Request, router.Params) (string, error) NewClient func(context.Context, *oauth2.Token) *http.Client // contains filtered or unexported fields }
Provider allows configuration of multiple oauth providers
func (*Provider) Client ¶
Client returns a new http client for authenticated requests. Provider can be configured with NewClient to override the default oauth2.Config.Client.
func (*Provider) HandleOAuthStart ¶
func (p *Provider) HandleOAuthStart(rw http.ResponseWriter, req *http.Request, par router.Params) error
HandleOAuthStart is the handler for redirecting to the oauth provider.
type RedirectCallbackFn ¶
RedirectCallbackFn is the type of the callback after successfully handling the oauth callback token exchange.
Click to show internal directories.
Click to hide internal directories.