Documentation ¶
Index ¶
- func ChallengeAndVerifier(q url.Values) func(url.Values)
- func MetaTokenSource(newT func() (*Token, error), newTS func(*Token) TokenSource) *metaTokenSource
- func RefreshTokenSource(token *Token, refresher TokenRefresher) *tokenSource
- type Token
- type TokenExchanger
- type TokenRefresher
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetaTokenSource ¶
func MetaTokenSource(newT func() (*Token, error), newTS func(*Token) TokenSource) *metaTokenSource
MetaTokenSource creates a token source that is created using the `newTS` function or recreated once it fails to return tokens. The recreation uses a new bootstrap token provided by the `newT` function.
func RefreshTokenSource ¶
func RefreshTokenSource(token *Token, refresher TokenRefresher) *tokenSource
Types ¶
type Token ¶
type Token struct { oauth2.Token IDToken string `json:"id_token,omitempty"` // contains filtered or unexported fields }
Token is an OAuth2-compatible token that supports the expires_in attribute
func (*Token) UnmarshalJSON ¶
type TokenExchanger ¶
type TokenExchanger interface { Exchange(q url.Values) (*Token, error) TokenSource(token *Token) TokenSource }
TokenExchanger exchanges a VW identity response into a (refreshing) VAG token source
type TokenRefresher ¶
TokenRefresher refreshes a token
type TokenSource ¶
type TokenSource interface { // Token returns an OAuth2 compatible token (id_token omitted) Token() (*oauth2.Token, error) // TokenEx returns the extended VAG token (id_token included) TokenEx() (*Token, error) }
TokenSource is a VAG token source compatible with oauth2.TokenSource
Click to show internal directories.
Click to hide internal directories.