Documentation
¶
Index ¶
Constants ¶
View Source
const FacebookProfileEndpoint = "https://graph.facebook.com/me?fields="
Variables ¶
View Source
var DefaultFacebookScopes = []string{"email", "public_profile"}
View Source
var DefaultGoogleScope = []string{"email"}
View Source
var FacebookEndpoint = oauth2.Endpoint{
AuthURL: "https://www.facebook.com/dialog/oauth",
TokenURL: "https://graph.facebook.com/oauth/access_token",
}
View Source
var GoogleEndpoint = oauth2.Endpoint{
AuthURL: "https://accounts.google.com/o/oauth2/auth",
TokenURL: "https://accounts.google.com/o/oauth2/token",
}
View Source
var GoogleProfileEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo"
Functions ¶
func NewFacebook ¶
Types ¶
type Facebook ¶
FacebookProvider implements the Provider interface for Facebook OAuth. It handles Facebook-specific OAuth flows, including user info retrieval.
func (*Facebook) FetchUserInfo ¶
func (f *Facebook) FetchUserInfo(client *http.Client, ctx context.Context, token *oauth2.Token) (models.UserInfo, error)
FetchUserInfo retrieves user information from Facebook using the provided OAuth client and token. It maps the Facebook user data to a UserInfo struct, including fields like ID, email, and name. Returns the UserInfo or an error if the request or parsing fails.
func (*Facebook) GetEndpoint ¶
GetEndpoint returns Facebook's OAuth 2.0 endpoints.
type Google ¶
GoogleProvider implements the Provider interface for Google OAuth. It handles Google-specific OAuth flows, including user info retrieval.
func (*Google) FetchUserInfo ¶
func (*Google) GetEndpoint ¶
GetEndpoint returns Google's OAuth 2.0 endpoints.
Click to show internal directories.
Click to hide internal directories.