facebook

package
v0.0.0-...-2a3cdc3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserInfoURL = "https://graph.facebook.com/me?access_token="

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	AuthorizeURL     string
	RedirectURL      string
	TokenURL         string
	Scopes           []string
	AuthorizeHandler func(context *auth.Context) (*claims.Claims, error)
}

Config facebook Config

type FacebookProvider

type FacebookProvider struct {
	*Config
}

FacebookProvider provide login with facebook method

func New

func New(config *Config) *FacebookProvider

func (FacebookProvider) Callback

func (provider FacebookProvider) Callback(context *auth.Context)

Callback implement Callback with facebook provider

func (FacebookProvider) ConfigAuth

func (provider FacebookProvider) ConfigAuth(auth *auth.Auth)

ConfigAuth config auth

func (FacebookProvider) GetName

func (FacebookProvider) GetName() string

GetName return provider name

func (FacebookProvider) Login

func (provider FacebookProvider) Login(context *auth.Context)

Login implemented login with facebook provider

func (FacebookProvider) Logout

func (FacebookProvider) Logout(context *auth.Context)

Logout implemented logout with facebook provider

func (FacebookProvider) OAuthConfig

func (provider FacebookProvider) OAuthConfig(context *auth.Context) *oauth2.Config

OAuthConfig return oauth config based on configuration

func (FacebookProvider) Register

func (provider FacebookProvider) Register(context *auth.Context)

Register implemented register with facebook provider

func (FacebookProvider) ServeHTTP

func (FacebookProvider) ServeHTTP(*auth.Context)

ServeHTTP implement ServeHTTP with facebook provider

type UserInfo

type UserInfo struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	GivenName  string `json:"first_name"`
	FamilyName string `json:"last_name"`
	Picture    string `json:"picture"`
	Profile    string `json:"link"`
	Email      string `json:"email"`
	Gender     string `json:"gender"`
	Locale     string `json:"locale"`
	Verified   bool   `json:"verified"`
}

UserInfo facebook user info structure

Jump to

Keyboard shortcuts

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