\Horde_Service_Facebook_Auth

Horde_Service_Facebook_Auth:: wrap functionality associated with authenticating to Facebook.

For now, only provide methods for authenticating that make sense from within a Horde context.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

Summary

Methods
Properties
Constants
__construct()
getOAuthUrl()
getAuthTokenUrl()
getSessionKey()
setSession()
revokeExtendedPermission()
getLoggedInUser()
No public properties found
EXTEND_PERMS_USER_ABOUT
EXTEND_PERMS_USER_BIRTHDAY
EXTEND_PERMS_USER_EVENTS
EXTEND_PERMS_USER_HOMETOWN
EXTEND_PERMS_USER_LOCATION
EXTEND_PERMS_USER_PHOTOS
EXTEND_PERMS_FRIENDS_ABOUT
EXTEND_PERMS_FRIENDS_BIRTHDAY
EXTEND_PERMS_FRIENDS_HOMETOWN
EXTEND_PERMS_FRIENDS_LOCATION
EXTEND_PERMS_FRIENDS_PHOTOS
EXTEND_PERMS_PUBLISHSTREAM
EXTEND_PERMS_READSTREAM
No protected methods found
$_facebook
$_http
$_sessionKey
N/A
No private methods found
No private properties found
N/A

Constants

EXTEND_PERMS_USER_ABOUT

EXTEND_PERMS_USER_ABOUT

User Data Perms *

EXTEND_PERMS_USER_BIRTHDAY

EXTEND_PERMS_USER_BIRTHDAY

EXTEND_PERMS_USER_EVENTS

EXTEND_PERMS_USER_EVENTS

EXTEND_PERMS_USER_HOMETOWN

EXTEND_PERMS_USER_HOMETOWN

EXTEND_PERMS_USER_LOCATION

EXTEND_PERMS_USER_LOCATION

EXTEND_PERMS_USER_PHOTOS

EXTEND_PERMS_USER_PHOTOS

EXTEND_PERMS_FRIENDS_ABOUT

EXTEND_PERMS_FRIENDS_ABOUT

Friends Data *

EXTEND_PERMS_FRIENDS_BIRTHDAY

EXTEND_PERMS_FRIENDS_BIRTHDAY

EXTEND_PERMS_FRIENDS_HOMETOWN

EXTEND_PERMS_FRIENDS_HOMETOWN

EXTEND_PERMS_FRIENDS_LOCATION

EXTEND_PERMS_FRIENDS_LOCATION

EXTEND_PERMS_FRIENDS_PHOTOS

EXTEND_PERMS_FRIENDS_PHOTOS

EXTEND_PERMS_PUBLISHSTREAM

EXTEND_PERMS_PUBLISHSTREAM

Misc *

EXTEND_PERMS_READSTREAM

EXTEND_PERMS_READSTREAM

Properties

$_http

$_http : \Horde_Http_Client

Type

\Horde_Http_Client

$_sessionKey

$_sessionKey : string

Cache the current auth_token.

Type

string

Methods

__construct()

__construct(\Horde_Service_Facebook  $facebook) 

Constructor

Parameters

\Horde_Service_Facebook $facebook

getOAuthUrl()

getOAuthUrl(string  $callback, array  $perms = array(), string  $state = null) : string

Get the URL for the user to authenticate the application and authorize various extender permissions/

Parameters

string $callback

The callback url. FB will redirect back to here.

array $perms

An array of FB permissions to request.

string $state

A random, but unique string for FB to return to ensure security.

Returns

string —

The URL.

getAuthTokenUrl()

getAuthTokenUrl(string  $code, string  $callback) : string

Returns the URL to obtain the auth_token from FB after getOAuthUrl redirects back to your callback URL.

Parameters

string $code

The code returned by FB after the OAuth2 dialog

string $callback

The callback url. Required in order to authenticate via OAuth2.

Returns

string —

The URL.

getSessionKey()

getSessionKey(string  $code = null, string  $callback = '') : string

Obtain the current access_token. Either returns the currently set token or, if a OAuth2 code is provided, sends a GET request to FB requesting the access_token.

Parameters

string $code

The code returned from FB's OAuth dialog.

string $callback

If provided, used as the callback URL required during the final steps in the OAuth2 process.

Throws

\Horde_Service_Facebook_Exception

Returns

string —

The access_token

setSession()

setSession(string  $sessionKey) 

Sets an existing access_token for this session.

Parameters

string $sessionKey

The FB OAuth2 access_token

revokeExtendedPermission()

revokeExtendedPermission(string  $perm) : \unknown_type

Revoke a previously authorizied extended permission

Parameters

string $perm

The extended permission to remove.

Returns

\unknown_type

getLoggedInUser()

getLoggedInUser() : string

Returns the user corresponding to the current session object.

Throws

\Horde_Service_Facebook_Exception

Returns

string —

User id