Documentation
¶
Index ¶
- func BuildAuthCodeURL(redirectURL string, config *oauth2.Config, opts *Options) (string, error)
- func Exchange(ctx context.Context, config *oauth2.Config, code string, options ...Option) (*oauth2.Token, error)
- func GenerateCodeChallenge(verifier string) string
- func GenerateCodeVerifier() string
- type AuthFlow
- type BrowserFlow
- type Option
- func WithAuthURLParam(key string, value string) Option
- func WithCodeVerifier(codeVerifier string) Option
- func WithPKCE(enabled bool) Option
- func WithPostParam(key string, value string) Option
- func WithPostParams(values map[string]string) Option
- func WithRedirectURL(redirectURL string) Option
- func WithScopes(scopes ...string) Option
- func WithState(state string) Option
- type Options
- type OutOfBandFlow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAuthCodeURL ¶ added in v0.21.0
BuildAuthCodeURL builds the authorization URL for the OAuth2 flow
func Exchange ¶ added in v0.21.0
func Exchange(ctx context.Context, config *oauth2.Config, code string, options ...Option) (*oauth2.Token, error)
Exchange exchanges the authorization code for an access token
func GenerateCodeChallenge ¶ added in v0.21.1
GenerateCodeChallenge creates a PKCE code challenge from a code verifier
func GenerateCodeVerifier ¶ added in v0.21.1
func GenerateCodeVerifier() string
GenerateCodeVerifier creates a random code verifier for PKCE
Types ¶
type BrowserFlow ¶
type BrowserFlow struct{}
func NewBrowserFlow ¶
func NewBrowserFlow() *BrowserFlow
type Option ¶
type Option func(*Options)
func WithAuthURLParam ¶
func WithCodeVerifier ¶ added in v0.21.0
WithCodeVerifier sets the code verifier for PKCE flow
func WithPostParam ¶
func WithPostParams ¶
func WithRedirectURL ¶ added in v0.21.0
func WithScopes ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewOptions ¶
func (*Options) CodeVerifier ¶
type OutOfBandFlow ¶
type OutOfBandFlow struct{}
func NewOutOfBandFlow ¶
func NewOutOfBandFlow() *OutOfBandFlow
Click to show internal directories.
Click to hide internal directories.