Documentation
¶
Overview ¶
Package device provides utility functions for device authentication flows as defined by RFC 8628, https://datatracker.ietf.org/doc/html/rfc8628.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthPromptFn ¶
DefaultAuthPromptFn is the default DeviceAuthPromptFn that prints to stderr.
func NewOAuthClient ¶
func NewOAuthClient(ctx context.Context, issuer *url.URL, clientID string, credStore credentials.Store, promptFn AuthPromptFn) (*http.Client, error)
NewOAuthClient creates an *http.Client capable of refreshing access tokens as needed. It prioritizes existing access and refresh tokens provided by the credentials.Store, falling back to device authorization as defined by RFC 8628 if necessary.
Types ¶
type AuthPromptFn ¶
AuthPromptFn prompts the authorization of a device by providing the verification URI and user code to the user. The "User Interaction" step of RFC 8628 https://www.rfc-editor.org/rfc/rfc8628#section-3.3.