Documentation
¶
Index ¶
- Constants
- func BuildAuthCodeURL(config *oauth2.Config, options ...Option) (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 AuthorizationExchange
- type BackendForFrontend
- type BackendForFrontendFlow
- type BrowserFlow
- type BrowserFlowOption
- type Endpoint
- 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 WithRedirectURI(redirectURL string) Option
- func WithScopes(scopes ...string) Option
- func WithState(state string) Option
- type Options
- type OutOfBandFlow
Constants ¶
View Source
const AuthorizationExchangeHeader = "X-Authorization-Exchange"
AuthorizationExchangeHeader is the header name used to pass the authorization exchange information by backend for frontend flow
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 AuthorizationExchange ¶ added in v0.24.0
func (*AuthorizationExchange) FromHeader ¶ added in v0.24.0
func (a *AuthorizationExchange) FromHeader(header string)
func (*AuthorizationExchange) ToHeader ¶ added in v0.24.0
func (a *AuthorizationExchange) ToHeader() string
type BackendForFrontend ¶ added in v0.24.0
type BackendForFrontend struct{}
func (*BackendForFrontend) BeginAuthorization ¶ added in v0.24.0
func (b *BackendForFrontend) BeginAuthorization(ctx context.Context, authorizationURI string) (*AuthorizationExchange, error)
type BackendForFrontendFlow ¶ added in v0.24.0
type BackendForFrontendFlow interface {
BeginAuthorization(ctx context.Context, authorizationURI string) (*AuthorizationExchange, error)
}
type BrowserFlow ¶
func NewBrowserFlow ¶
func NewBrowserFlow(opts ...BrowserFlowOption) *BrowserFlow
NewBrowserFlow create new browser flow
type BrowserFlowOption ¶ added in v0.25.0
type BrowserFlowOption func(*BrowserFlow)
BrowserFlowOption represents browser flow
func WithNewEndpoint ¶ added in v0.25.0
func WithNewEndpoint(newEndpoint func() (Endpoint, error)) BrowserFlowOption
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 WithRedirectURI ¶ added in v0.22.0
func WithScopes ¶
type OutOfBandFlow ¶
type OutOfBandFlow struct{}
func NewOutOfBandFlow ¶
func NewOutOfBandFlow() *OutOfBandFlow
Source Files
¶
Click to show internal directories.
Click to hide internal directories.