Documentation ¶
Overview ¶
Package authorizationcode implements the OAuth 2.0 Authorization Code Grant with the PKCE extension.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Config is the OAuth2 configuration to use for this authorization flow oauth2.Config // EndpointParams specifies additional parameters for requests to the authorization endpoint. EndpointParams url.Values // contains filtered or unexported fields }
Config implements an authorization code flow with proof key for code exchange.
func NewAuthorizationCodeFlowWithPKCE ¶
NewAuthorizationCodeFlowWithPKCE creates a new authorization flow using the supplied OAuth2 configuration.
func (*Config) AuthCodeURLWithPKCE ¶
AuthCodeURLWithPKCE returns the browser URL for the user to start the authorization flow.
func (*Config) Callback ¶
func (c *Config) Callback(handler Handler, response ResponseFunc) http.Handler
Callback implements an HTTP handler for the target of the OAuth2 redirect URL.
func (*Config) CallbackAddr ¶
CallbackAddr returns the address of the callback server (i.e. the host of the OAuth redirect URL)
type Handler ¶
Handler is an asynchronous callback for receiving the token after a successful exchange.
type ResponseFunc ¶
ResponseFunc is used to handle response generation from the HTTP callback server.