Documentation
¶
Index ¶
- func GenerateState() (string, error)
- type Client
- func (c *Client) BuildAuthorizationURL(clientID string, redirectURI string, state string, challenge *PKCEChallenge, ...) string
- func (c *Client) GetAuthConfig(scopes []string) *types.AuthConfig
- func (c *Client) ParseCallbackError(errorCode, errorDescription string) error
- func (c *Client) ValidateCallback(code, state, expectedState string) error
- type PKCEChallenge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateState ¶
GenerateState generates a random state parameter for CSRF protection
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles OAuth2 authorization flow
func (*Client) BuildAuthorizationURL ¶
func (c *Client) BuildAuthorizationURL( clientID string, redirectURI string, state string, challenge *PKCEChallenge, scopes []string, ) string
BuildAuthorizationURL builds the OAuth2 authorization URL with PKCE
func (*Client) GetAuthConfig ¶
func (c *Client) GetAuthConfig(scopes []string) *types.AuthConfig
GetAuthConfig returns the authentication configuration
func (*Client) ParseCallbackError ¶
ParseCallbackError parses OAuth error from callback parameters
func (*Client) ValidateCallback ¶
ValidateCallback validates the OAuth callback parameters
type PKCEChallenge ¶
PKCEChallenge represents a PKCE code challenge
func GeneratePKCEChallenge ¶
func GeneratePKCEChallenge() (*PKCEChallenge, error)
GeneratePKCEChallenge generates a PKCE code verifier and challenge Uses S256 method as specified in RFC 7636
Click to show internal directories.
Click to hide internal directories.