Documentation
¶
Overview ¶
Package github configures GitHub OAuth 2.0 sign-in for the oauth plugin.
GitHub is not an OpenID Connect provider: the token endpoint returns no ID token, so identity comes from GitHub's authenticated user API using the transient access token. The immutable subject is the account's numeric "id". The mutable "login", the email addresses and the profile are never used.
Index ¶
Constants ¶
View Source
const ( ID = "github" Namespace = "https://github.com" AuthorizationURL = "https://github.com/login/oauth/authorize" TokenURL = "https://github.com/login/oauth/access_token" UserURL = "https://api.github.com/user" )
Endpoints are fixed for github.com. GitHub Enterprise Server hosts would need a reviewed adapter with their own namespace; this package does not guess.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ClientID string
ClientSecret sigil.Secret
// RedirectURL is the exact HTTPS authorization callback URL registered on
// the OAuth App. GitHub permits any port for localhost callbacks.
RedirectURL string
// Scopes are optional. The default empty scope grants read-only access to
// public profile information, which is all the identity API call needs.
Scopes []string
}
Config is trusted host configuration for one GitHub OAuth App.
Click to show internal directories.
Click to hide internal directories.