Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateState ¶
func GenerateState() string
GenerateState returns a cryptographically random 64-character hex string for use as the OAuth2 state parameter.
Types ¶
type Provider ¶
type Provider struct {
Name string
ClientID string
ClientSecret string
RedirectURL string
Scopes []string
AuthURL string
TokenURL string
UserInfoURL string
// contains filtered or unexported fields
}
Provider configures an OAuth2 provider (e.g., Google, GitHub).
func NewProvider ¶
func NewProvider(name, clientID, clientSecret, redirectURL string, scopes []string, authURL, tokenURL, userInfoURL string, parser func(map[string]any) UserInfo) *Provider
NewProvider creates a custom OAuth2 provider with the given configuration.
func (*Provider) AuthCodeURL ¶
AuthCodeURL builds the authorization redirect URL with the provided state.
Click to show internal directories.
Click to hide internal directories.