Versions in this module Expand all Collapse all v1 v1.0.0 Jun 1, 2024 Changes in this version + const ClaimNameName + const ClaimNameSubject + const ClaimNameUserName + const DATA + const FILE + func ExtractUserName(token oauth2.Token) (string, error) + type AuthorizationCodeExchangeRequest struct + ClientID string + Code string + CodeVerifier string + RedirectURI string + TokenEndpoint string + type AuthorizationGrant struct + Audience string + ClientCredentials *KeyFile + ClientID string + Scopes []string + Token *oauth2.Token + TokenEndpoint string + Type AuthorizationGrantType + type AuthorizationGrantRefresher interface + Refresh func(grant *AuthorizationGrant) (*AuthorizationGrant, error) + type AuthorizationGrantType string + const GrantTypeClientCredentials + const GrantTypeDeviceCode + type AuthorizationTokenResponse struct + AccessToken string + ExpiresIn int + IDToken string + RefreshToken string + TokenType string + type ClientCredentialsExchangeRequest struct + Audience string + ClientID string + ClientSecret string + Scopes []string + TokenEndpoint string + type ClientCredentialsExchanger interface + ExchangeClientCredentials func(req ClientCredentialsExchangeRequest) (*TokenResult, error) + type ClientCredentialsFlow struct + func NewDefaultClientCredentialsFlow(options ClientCredentialsFlowOptions) (*ClientCredentialsFlow, error) + func (c *ClientCredentialsFlow) Authorize(audience string) (*AuthorizationGrant, error) + type ClientCredentialsFlowOptions struct + AdditionalScopes []string + KeyFile string + type ClientCredentialsGrantRefresher struct + func NewDefaultClientCredentialsGrantRefresher(clock clock.Clock) (*ClientCredentialsGrantRefresher, error) + func (g *ClientCredentialsGrantRefresher) Refresh(grant *AuthorizationGrant) (*AuthorizationGrant, error) + type ClientCredentialsProvider interface + GetClientCredentials func() (*KeyFile, error) + type ConfigBackedCachingProvider struct + func NewConfigBackedCachingProvider(clientID, audience string, config configProvider) *ConfigBackedCachingProvider + func (c *ConfigBackedCachingProvider) CacheTokens(toCache *TokenResult) error + func (c *ConfigBackedCachingProvider) GetTokens() (*TokenResult, error) + type DeviceAuthorizationGrantRefresher struct + func NewDefaultDeviceAuthorizationGrantRefresher(clock clock.Clock) (*DeviceAuthorizationGrantRefresher, error) + func (g *DeviceAuthorizationGrantRefresher) Refresh(grant *AuthorizationGrant) (*AuthorizationGrant, error) + type DeviceCodeCallback func(code *DeviceCodeResult) error + type DeviceCodeExchangeRequest struct + ClientID string + DeviceCode string + PollInterval time.Duration + TokenEndpoint string + type DeviceCodeFlow struct + func NewDefaultDeviceCodeFlow(options DeviceCodeFlowOptions, callback DeviceCodeCallback) (*DeviceCodeFlow, error) + func (p *DeviceCodeFlow) Authorize(audience string) (*AuthorizationGrant, error) + type DeviceCodeFlowOptions struct + AdditionalScopes []string + AllowRefresh bool + ClientID string + IssuerEndpoint string + type DeviceCodeProvider interface + GetCode func(audience string, additionalScopes ...string) (*DeviceCodeResult, error) + type DeviceCodeRequest struct + Audience string + ClientID string + Scopes []string + type DeviceCodeResult struct + DeviceCode string + ExpiresIn int + Interval int + UserCode string + VerificationURI string + VerificationURIComplete string + type DeviceTokenExchanger interface + ExchangeDeviceCode func(ctx context.Context, req DeviceCodeExchangeRequest) (*TokenResult, error) + ExchangeRefreshToken func(req RefreshTokenExchangeRequest) (*TokenResult, error) + type Flow interface + Authorize func(audience string) (*AuthorizationGrant, error) + type HTTPAuthTransport interface + Do func(request *http.Request) (*http.Response, error) + type Issuer struct + Audience string + ClientID string + IssuerEndpoint string + type KeyFile struct + ClientEmail string + ClientID string + ClientSecret string + IssuerURL string + Type string + type KeyFileProvider struct + KeyFile string + func NewClientCredentialsProviderFromKeyFile(keyFile string) *KeyFileProvider + func (k *KeyFileProvider) GetClientCredentials() (*KeyFile, error) + type LocalDeviceCodeProvider struct + func NewLocalDeviceCodeProvider(options LocalDeviceCodeProviderOptions, ...) *LocalDeviceCodeProvider + func (cp *LocalDeviceCodeProvider) GetCode(audience string, additionalScopes ...string) (*DeviceCodeResult, error) + type LocalDeviceCodeProviderOptions struct + ClientID string + type OIDCWellKnownEndpoints struct + AuthorizationEndpoint string + DeviceAuthorizationEndpoint string + TokenEndpoint string + func GetOIDCWellKnownEndpointsFromIssuerURL(issuerURL string) (*OIDCWellKnownEndpoints, error) + type RefreshTokenExchangeRequest struct + ClientID string + RefreshToken string + TokenEndpoint string + type TokenError struct + ErrorCode string + ErrorDescription string + func (e *TokenError) Error() string + type TokenErrorResponse struct + Error string + ErrorDescription string + type TokenResult struct + AccessToken string + ExpiresIn int + IDToken string + RefreshToken string + type TokenRetriever struct + func NewTokenRetriever(authTransport HTTPAuthTransport) *TokenRetriever + func (ce *TokenRetriever) ExchangeClientCredentials(req ClientCredentialsExchangeRequest) (*TokenResult, error) + func (ce *TokenRetriever) ExchangeCode(req AuthorizationCodeExchangeRequest) (*TokenResult, error) + func (ce *TokenRetriever) ExchangeDeviceCode(ctx context.Context, req DeviceCodeExchangeRequest) (*TokenResult, error) + func (ce *TokenRetriever) ExchangeRefreshToken(req RefreshTokenExchangeRequest) (*TokenResult, error)