Documentation ¶
Index ¶
- func NewDatabaseTokenSource(db storage.Database, service string, config *oauth2.Config, tok *oauth2.Token) oauth2.TokenSource
- func RandomState() string
- func RunOauth2CallbackServer(redirectURL url.URL, param string, responseChan chan CodeResponse)
- type AuthUrl
- type CodeResponse
- type OAuth2Authenticator
- type OAuth2Strategy
- type StandardStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseTokenSource ¶ added in v0.2.0
func RandomState ¶ added in v0.3.0
func RandomState() string
func RunOauth2CallbackServer ¶
func RunOauth2CallbackServer(redirectURL url.URL, param string, responseChan chan CodeResponse)
Types ¶
type CodeResponse ¶
type OAuth2Authenticator ¶ added in v0.4.0
type OAuth2Authenticator interface { models.Backend // Returns OAuth2 config suitable for this backend OAuth2Strategy(redirectUrl *url.URL) OAuth2Strategy // Setup the OAuth2 client OAuth2Setup(token oauth2.TokenSource) error }
Must be implemented by backends requiring OAuth2 authentication
type OAuth2Strategy ¶
type OAuth2Strategy interface { Config() oauth2.Config AuthCodeURL(verifier string, state string) AuthUrl ExchangeToken(code CodeResponse, verifier string) (*oauth2.Token, error) }
func NewStandardStrategy ¶
func NewStandardStrategy(conf oauth2.Config) OAuth2Strategy
type StandardStrategy ¶
type StandardStrategy struct {
// contains filtered or unexported fields
}
func (StandardStrategy) AuthCodeURL ¶
func (s StandardStrategy) AuthCodeURL(verifier string, state string) AuthUrl
func (StandardStrategy) Config ¶
func (s StandardStrategy) Config() oauth2.Config
func (StandardStrategy) ExchangeToken ¶
func (s StandardStrategy) ExchangeToken(code CodeResponse, verifier string) (*oauth2.Token, error)
Click to show internal directories.
Click to hide internal directories.