Facebook's "fb_sig" and "OAuth 2.0 for Canvas"
I'm trying to get the "fb_sig开发者_开发技巧" parameters that facebook is supposed to provide by using this code:
$parms='';
foreach ($_REQUEST as $name=>$val)
{
if (substr($name,0,6)!='fb_sig') continue;
if ($parms!='') $parms.='&';
$parms.=$name.'='.$val;
}
I need that in order to send those parameters to the php code that needs to use facebook api (ie. to get a friends list) , and so far it used to work ok. I got the code from here: http://www.foobots.net/breakouts.html
But when I activate the "OAuth 2.0 for Canvas" to be able to use the facebook credits api, then "Parms" ends up being an empty string. No "fb_sig" parameters at all. And when I parse the signed_request, they're not there either.
Is it possible to use "OAuth 2.0 for Canvas" and still have access to "fb_sig" parameters?
Your app will be set to receive either "fb_sig" parameters OR the "signed_request" parameter. The fb_sig parameters are the old way Facebook used to do it. signed_request is the new way. By decoding the signed_request parameter, I believe you can access the same information as contained in the individual fb_sig_* parameters.
For older apps, you can swap between fb_sig_* and signed_request by changing the advanced option "signed_request for Canvas" in your advanced app settings.
New apps ONLY have the option of signed_request, no option to change it in the App settings.
Note, this is as of September 2011, by next year all this may have changed.. again.
Have a look at
Facebook Canvas Auth
Facebook Signed Request
I dont think both methods at the same time will be working! Hope that helps
精彩评论