Versions in this module Expand all Collapse all v1 v1.0.2 Dec 5, 2023 v1.0.1 Dec 5, 2023 Changes in this version + var HTTPClient internal.ContextKey + var NoContext = context.TODO() + func GenerateVerifier() string + func NewClient(ctx context.Context, src TokenSource) *http.Client + func RegisterBrokenAuthHeaderProvider(tokenURL string) + func S256ChallengeFromVerifier(verifier string) string + type AuthCodeOption interface + var AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") + var AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") + var ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") + func S256ChallengeOption(verifier string) AuthCodeOption + func SetAuthURLParam(key, value string) AuthCodeOption + func VerifierOption(verifier string) AuthCodeOption + type AuthStyle int + const AuthStyleAutoDetect + const AuthStyleInHeader + const AuthStyleInParams + type Config struct + ClientID string + ClientSecret string + Endpoint Endpoint + RedirectURL string + Scopes []string + func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string + func (c *Config) Client(ctx context.Context, t *Token) *http.Client + func (c *Config) DeviceAccessToken(ctx context.Context, da *DeviceAuthResponse, opts ...AuthCodeOption) (*Token, error) + func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*DeviceAuthResponse, error) + func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) + func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) + func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource + type DeviceAuthResponse struct + DeviceCode string + Expiry time.Time + Interval int64 + UserCode string + VerificationURI string + VerificationURIComplete string + func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error + func (d DeviceAuthResponse) MarshalJSON() ([]byte, error) + type Endpoint struct + AuthStyle AuthStyle + AuthURL string + DeviceAuthURL string + TokenURL string + type RetrieveError struct + Body []byte + ErrorCode string + ErrorDescription string + ErrorURI string + Response *http.Response + func (r *RetrieveError) Error() string + type Token struct + AccessToken string + Expiry time.Time + RefreshToken string + TokenType string + func (t *Token) Extra(key string) interface{} + func (t *Token) SetAuthHeader(r *http.Request) + func (t *Token) Type() string + func (t *Token) Valid() bool + func (t *Token) WithExtra(extra interface{}) *Token + type TokenSource interface + Token func() (*Token, error) + func ReuseTokenSource(t *Token, src TokenSource) TokenSource + func ReuseTokenSourceWithExpiry(t *Token, src TokenSource, earlyExpiry time.Duration) TokenSource + func StaticTokenSource(t *Token) TokenSource + type Transport struct + Base http.RoundTripper + Source TokenSource + func (t *Transport) CancelRequest(req *http.Request) + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)