problems with extended permissions

5 views
Skip to first unread message

Paco Garat

unread,
May 18, 2012, 8:11:02 AM5/18/12
to facebook-ap...@googlegroups.com
Hi, first sorry for my english, i am developing a facebook app with symfony framework, and i have a problem with the scope parameter. I get the access_token with this code:

$appId=$this->container->getParameter('oauth.facebook.appId');
$secret=$this->container->getParameter('oauth.facebook.secret');
$code=$this->getRequest()->get('code');
$scope='read_mailbox';
. "client_id=" . $appId."&redirect_uri=" .urlencode("https://87.218.201.45/login/facebook"). "&scope=".$scope 
."&client_secret=" . $secret . "&code=" . $code;
$url = $token_url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
echo $result;
$params = null;
parse_str($result, $params);
$token=$params['access_token'];
curl_close($ch);
return $token;

but when the enhanced oauth dialog appears doesn't show the extended permission and when i execute this query:

$this->fql('SELECT+message_id+FROM+message+WHERE+message_id+>+0', $token, false);

i've got this error:

{"error":{"message":"An access token is required to request this resource.","type":"OAuthException","code":104}}

I don't have problems accessing public information.

Thanks for helping me,
Paco Garat 
Reply all
Reply to author
Forward
0 new messages