PHP Class Horde_Service_Facebook_Auth, horde

For now, only provide methods for authenticating that make sense from within a Horde context. Copyright 2009-2016 Horde LLC (http://www.horde.org/)
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Horde_Service_Facebook_Base
Exibir arquivo Open project: horde/horde

Protected Properties

Property Type Description
$_sessionKey string Cache the current auth_token.

Public Methods

Method Description
getAuthTokenUrl ( string $code, string $callback ) : string Returns the URL to obtain the auth_token from FB after getOAuthUrl redirects back to your callback URL.
getLoggedInUser ( ) : string Returns the user corresponding to the current session object.
getOAuthUrl ( string $callback, array $perms = [], string $state = null ) : string Get the URL for the user to authenticate the application and authorize various extender permissions/
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.
revokeExtendedPermission ( string $perm ) : unknown_type Revoke a previously authorizied extended permission
setSession ( string $sessionKey ) Sets an existing access_token for this session.

Method Details

getAuthTokenUrl() public method

Returns the URL to obtain the auth_token from FB after getOAuthUrl redirects back to your callback URL.
public getAuthTokenUrl ( string $code, string $callback ) : string
$code string The code returned by FB after the OAuth2 dialog
$callback string The callback url. Required in order to authenticate via OAuth2.
return string The URL.

getLoggedInUser() public method

Returns the user corresponding to the current session object.
public getLoggedInUser ( ) : string
return string User id

getOAuthUrl() public method

Get the URL for the user to authenticate the application and authorize various extender permissions/
public getOAuthUrl ( string $callback, array $perms = [], string $state = null ) : string
$callback string The callback url. FB will redirect back to here.
$perms array An array of FB permissions to request.
$state string A random, but unique string for FB to return to ensure security.
return string The URL.

getSessionKey() public method

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.
public getSessionKey ( string $code = null, string $callback = '' ) : string
$code string The code returned from FB's OAuth dialog.
$callback string If provided, used as the callback URL required during the final steps in the OAuth2 process.
return string The access_token

revokeExtendedPermission() public method

Revoke a previously authorizied extended permission
public revokeExtendedPermission ( string $perm ) : unknown_type
$perm string The extended permission to remove.
return unknown_type

setSession() public method

Sets an existing access_token for this session.
public setSession ( string $sessionKey )
$sessionKey string The FB OAuth2 access_token

Property Details

$_sessionKey protected_oe property

Cache the current auth_token.
protected string $_sessionKey
return string