Documentation
¶
Index ¶
Constants ¶
View Source
const ( //FacebookProvider is const for 'facebook' FacebookProvider = "facebook" //GoogleProvider is const for 'google' GoogleProvider = "google" //GitHubProvider is const for 'github' GitHubProvider = "github" )
Variables ¶
View Source
var ErrUserIDRequired = errors.New("UserID is required during OAuth integration")
ErrUserIDRequired is used when OAuth integration returns an empty user ID
Functions ¶
This section is empty.
Types ¶
type ProviderOption ¶ added in v0.15.0
type ProviderOption struct {
Provider string `json:"provider"`
DisplayName string `json:"displayName"`
ClientID string `json:"clientID"`
URL string `json:"url"`
CallbackURL string `json:"callbackURL"`
LogoBlobKey string `json:"logoBlobKey"`
IsCustomProvider bool `json:"isCustomProvider"`
IsEnabled bool `json:"isEnabled"`
}
ProviderOption represents an OAuth provider that can be used to authenticate
type Service ¶
type Service interface {
GetAuthURL(provider, redirect, identifier string) (string, error)
GetProfile(provider string, code string) (*UserProfile, error)
GetRawProfile(provider string, code string) (string, error)
ParseRawProfile(provider, body string) (*UserProfile, error)
ListActiveProviders() ([]*ProviderOption, error)
ListAllProviders() ([]*ProviderOption, error)
}
Service provides OAuth operations
type UserProfile ¶
type UserProfile struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
}
UserProfile represents an OAuth user profile
Click to show internal directories.
Click to hide internal directories.