Documentation
¶
Overview ¶
Package devicelogin signs a person in with the OAuth device authorization grant (RFC 8628) against any OIDC issuer, and keeps the token in a file that only the user reads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath is the file of the token of tool, under the user configuration directory.
Types ¶
type Config ¶
type Config struct {
Issuer string
ClientID string
// Scope defaults to "openid email".
Scope string
Client *http.Client
Now func() time.Time
// Wait pauses for d between polls, or returns the error of ctx. It defaults to a timer.
Wait func(ctx context.Context, d time.Duration) error
// Prompt tells the person where to go and what to enter.
Prompt func(verificationURI, userCode, verificationURIComplete string)
}
Config is one login.
type Token ¶
type Token struct {
Issuer string `json:"issuer"`
Value string `json:"token"`
Expires time.Time `json:"expires"`
}
Token is the credential that a login gave. It is the ID token when the issuer returns one, and the access token otherwise: the ID token is a JWT whose audience is the client.