Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( AuthMethodBasicAuth AuthMethod = "basic_auth" AuthMethodRequestBody AuthMethod = "request_body" )
type Config ¶
type Config struct { TokenURL string `mapstructure:"token_url" validate:"required,url"` ClientID string `mapstructure:"client_id" validate:"required"` ClientSecret string `mapstructure:"client_secret" validate:"required"` AuthMethod AuthMethod `mapstructure:"auth_method" validate:"omitempty,oneof=basic_auth request_body"` Scopes []string `mapstructure:"scopes"` TTL *time.Duration `mapstructure:"cache_ttl"` }
type TokenEndpointResponse ¶
type TokenEndpointResponse struct { *TokenInfoResponse *TokenErrorResponse }
func (TokenEndpointResponse) TokenInfo ¶
func (r TokenEndpointResponse) TokenInfo() (*TokenInfo, error)
type TokenErrorResponse ¶
type TokenErrorResponse struct { ErrorType string `json:"error,omitempty"` ErrorDescription string `json:"error_description,omitempty"` ErrorURI string `json:"error_uri,omitempty"` }
func (*TokenErrorResponse) Error ¶
func (e *TokenErrorResponse) Error() string
type TokenInfo ¶
type TokenInfoResponse ¶
type TokenInfoResponse struct { AccessToken string `json:"access_token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` TokenType string `json:"token_type,omitempty"` ExpiresIn int64 `json:"expires_in,omitempty"` Scope string `json:"scope,omitempty"` }
func (*TokenInfoResponse) Type ¶
func (t *TokenInfoResponse) Type() string
Click to show internal directories.
Click to hide internal directories.