facebook

package
v1.15.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Endpoint = oauth2.Endpoint{
	AuthURL:  "https://www.facebook.com/v22.0/dialog/oauth",
	TokenURL: "https://graph.facebook.com/v22.0/oauth/access_token",
}

Endpoint pins a current Graph API version; the constants shipped with golang.org/x/oauth2/facebook still point at the retired v3.2 dialog.

Functions

This section is empty.

Types

type Client

type Client struct {
	*oauth2.Config
}

func New

func New(config *Config) *Client

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(token string) (*UserInfo, error)

GetUserInfo fetches the user profile from the Graph API. Facebook only returns the email field when the account has a confirmed address and the user granted the email permission, so a non-empty value is verified.

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string
}

type UserInfo

type UserInfo struct {
	OpenID  string
	Name    string
	Email   string
	Picture string
}

UserInfo is the subset of the Graph API "me" node the login flow needs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL