64 assert(
'is_array($info)');
65 assert(
'is_array($config)');
72 $this->api_key = $cfgParse->getString(
'api_key');
73 $this->secret = $cfgParse->getString(
'secret');
74 $this->req_perms = $cfgParse->getString(
'req_perms', NULL);
75 $this->user_fields = $cfgParse->getString(
'user_fields', NULL);
85 assert(
'is_array($state)');
92 $facebook->destroySession();
95 $url = $facebook->getLoginUrl(
array(
'redirect_uri' => $linkback,
'scope' => $this->req_perms));
103 assert(
'is_array($state)');
106 $uid = $facebook->getUser();
108 if (isset($uid) && $uid) {
110 $info = $facebook->api(
"/" . $uid . ($this->user_fields ?
"?fields=" . $this->user_fields :
""));
122 if (is_string($value) && !empty($value)) {
127 if (array_key_exists(
'third_party_id',
$info)) {
140 $facebook->destroySession();
$req_perms
Which additional data permissions to request from user.
const AUTHID
The key of the AuthId field in the state.
$secret
Facebook App Secret.
__construct($info, $config)
Constructor for this authentication source.
Extends the BaseFacebook class with the intent of using PHP sessions to store user ids and access tok...
$user_fields
A comma-separated list of user profile fields to request.
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
authenticate(&$state)
Log-in using Facebook platform.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
const STAGE_INIT
The string used to identify our states.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
$api_key
Facebook App ID or API Key.
Create styles array
The data for the language used.
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.
static saveState(&$state, $stage, $rawId=false)
Save the state.
Copyright 2011 Facebook, Inc.