开发者

Facebook POST of Canvas missing session

I have a Flash app that is using the Big Spaceship classes (http://www.bigspaceship.com/blog/labs/bss-classes-flash-and-the-fb-graph/) to perform authorisation. This was working fine until Facebook rolled out POST for Canvas. As suggested in the migration documents I have activated POST for Canvas in the app settings, and changed the PHP that pulls the session data From using $_GET to $_REQUEST, but there is no longer开发者_高级运维 a parameter called session in the $_REQUEST object.

<?php
    $session = '';
if( isset( $_REQUEST["session"] ) )
{
    $session = urldecode( $_REQUEST["session"] );
    if( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE') )
    {
        $session = htmlspecialchars( $session );
    }
}
?>

This is supposed to be a JSON string containing all the session data from Facebook, which Big Spaceship's OAuthBridge class requires. Does anyone know why this data is no longer present, or what the old JSON property names were so I can reconstruct it myself?


The information you want is not in a parameter called "session" it's in the "signed_request" parameter. You need to decode that, which contains a json array and the session key is in oauth_token.

There is an example here (scroll down): http://developers.facebook.com/docs/guides/canvas/

Signed request documented here: http://developers.facebook.com/docs/authentication/signed_request/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜