Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct { IdentityURL string // contains filtered or unexported fields }
Provider holds all the info for our Oauth2 provider.
func New ¶
func New() *Provider
New returns a new provider. Some providers have their endpoints as part of the Oauth2 package.
func (*Provider) BuildAuthURL ¶
BuildAuthURL builds the authenticartion endpoint that we redirect our users to. State needs to be an unguessable string (probability of guessing < 2^128).
It might be possible here to write some helper that generates a cryptographically secure state string, and uses that an a nonce. Since the provider instance is "alive" across our middleware, we could tack the nonce onto the middleware, and verify it once the identity provider returns it?
func (*Provider) GetCodeURL ¶
GetCodeURL gets the short-lived access code from the callback URL that we can exchange for an access token.
func (*Provider) GetIdentity ¶
GetIdentity gets the client's identity from the provider.