Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface { AuthorizeLink(redirectURI string, state string) string ParseResponse(r *http.Request, state string) (string, error) }
func NewAuthorizer ¶
func NewAuthorizer(authURI, clientID string, scopes ...string) Authorizer
type CallbackHandler ¶
type CallbackHandler struct {
// contains filtered or unexported fields
}
func NewCallbackHandler ¶
func NewCallbackHandler(redirectURL *url.URL, authorizer Authorizer) (CallbackHandler, error)
func (CallbackHandler) AuthorizeURL ¶
func (s CallbackHandler) AuthorizeURL() string
func (CallbackHandler) ListenURL ¶
func (s CallbackHandler) ListenURL() string
func (CallbackHandler) WithAuthorizationCode ¶
func (s CallbackHandler) WithAuthorizationCode(callback func(string) error) error
WithAuthorizationCode executes the provided function with the resulting authorization code or error. Afterwards the user is redirected to the CallbackHandler's baseRedirectURL. If the callback produced an error, the error is appended to the redirect url: &error=<error>. The provided callback function will only be executed once, even if multiple successful callbacks arrive at the server. This function returns when the callback has been executed and the user is redirected.
Click to show internal directories.
Click to hide internal directories.