Documentation ¶
Index ¶
- type OAuth2Config
- func (o *OAuth2Config) ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error)
- func (o *OAuth2Config) ExchangeRefreshForToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
- func (o *OAuth2Config) GenerateAuthCodeURL(state string, scopes []string, options []oauth2.AuthCodeOption) string
- func (o *OAuth2Config) GetTokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OAuth2Config ¶
type OAuth2Config struct {
ClientID, ClientSecret string
Endpoint oauth2.Endpoint
RedirectURL string
}
OAuth2Config is an implementation of the OAuth2Config interface
func (*OAuth2Config) ExchangeCodeForToken ¶
func (o *OAuth2Config) ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error)
ExchangeCodeForToken takes the final step in the OAuth flow and fetches an ID token
func (*OAuth2Config) ExchangeRefreshForToken ¶
func (o *OAuth2Config) ExchangeRefreshForToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
ExchangeRefreshForToken exchanges a refresh token for a standard token, and thus can be used to extend sessions
func (*OAuth2Config) GenerateAuthCodeURL ¶
func (o *OAuth2Config) GenerateAuthCodeURL(state string, scopes []string, options []oauth2.AuthCodeOption) string
GenerateAuthCodeURL generates the URL to visit to authenticate the user
func (*OAuth2Config) GetTokenSource ¶
func (o *OAuth2Config) GetTokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
GetTokenSource returns a token source to get a token from, based on the provided token
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier is an implementation of the Verifier interface
func NewOIDCVerifier ¶
func NewOIDCVerifier(v *oidc.IDTokenVerifier) Verifier
NewOIDCVerifier constructs a new oidc.Verifier with the given IDTokenVerifier
Click to show internal directories.
Click to hide internal directories.