facebook

package
v0.0.0-...-5c487ac Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	IdentityProvider IdentityProvider
	Account          Account
}

API represents Facebook API client.

func NewAPI

func NewAPI(identityProvider IdentityProvider, account Account) API

NewAPI creates Facebook API client.

type Account

type Account struct {
	// contains filtered or unexported fields
}

Account accesses user's account data through FB Graph API.

func NewAccount

func NewAccount(httpRequest webreq.HTTP) Account

NewAccount initializes Facebook account API client.

func (Account) GetSingleSignOnUser

func (g Account) GetSingleSignOnUser(accessToken string) (entity.SSOUser, error)

GetSingleSignOnUser retrieves user's email and name from Facebook API.

type AccountLinker

type AccountLinker sso.AccountLinker

AccountLinker links user's Facebook account with Short account.

type IdentityProvider

type IdentityProvider struct {
	// contains filtered or unexported fields
}

IdentityProvider represents Facebook OAuth service.

func NewIdentityProvider

func NewIdentityProvider(
	httpRequest webreq.HTTP,
	clientID string,
	clientSecret string,
	redirectURI string,
) IdentityProvider

NewIdentityProvider initializes Facebook OAuth service.

func (IdentityProvider) GetAuthorizationURL

func (g IdentityProvider) GetAuthorizationURL() string

GetAuthorizationURL retrieves the URL of Facebook sign in page.

func (IdentityProvider) RequestAccessToken

func (g IdentityProvider) RequestAccessToken(authorizationCode string) (accessToken string, err error)

RequestAccessToken retrieves access token of user's Facebook account using authorization code.

type SingleSignOn

type SingleSignOn sso.SingleSignOn

SingleSignOn enables users to sign in through their Facebook account.

Jump to

Keyboard shortcuts

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