Documentation
¶
Overview ¶
Package github implements the GitHub OAuth provider for Auth-All.
Index ¶
Constants ¶
View Source
const ( DefaultAuthURL = "https://github.com/login/oauth/authorize" DefaultTokenURL = "https://github.com/login/oauth/access_token" DefaultUserURL = "https://api.github.com/user" DefaultEmailsURL = "https://api.github.com/user/emails" )
Default GitHub endpoints.
View Source
const ProviderID = "github"
ProviderID is the stable identifier of this provider.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures the provider.
func WithClientSecret ¶
WithClientSecret sets the OAuth client secret.
func WithEndpoints ¶
WithEndpoints overrides the provider endpoints. Tests use it to point at a deterministic fake GitHub server.
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used for provider calls.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the GitHub OAuth provider.
func (*Provider) AuthCodeURL ¶
func (p *Provider) AuthCodeURL(req oauth.AuthRequest) (string, error)
AuthCodeURL implements oauth.Provider.
func (*Provider) Exchange ¶
func (p *Provider) Exchange(ctx context.Context, req oauth.ExchangeRequest) (*oauth.Identity, error)
Exchange implements oauth.Provider.
func (*Provider) SupportsPKCE ¶
SupportsPKCE implements oauth.Provider. GitHub does not accept a PKCE challenge on the OAuth app authorization endpoint.
Click to show internal directories.
Click to hide internal directories.