duanmeng7865 2017-02-02 12:23
浏览 52

Facebook将php-sdk-v4升级为graph-sdk v5,在弹出窗口中登录

I am trying to upgrade Facebook php-sdk-v4 to graph-sdk, and after following all the steps from documentations, I reached a problem. The idea, which is what we were being doing until now, is to log him to our site with his FB account. But now, instead session, v5 wants accessToken, that when trying to get it ($helper->getAccessToken()) finishes into a return $_GET['code']. Happens that our procedure is to open the FB login page in a popup (colorbox), and first it complains that it can't take the get 'code', but if i open it in a new tab, the url has the 'code' parameter as $_GET method, put this exception appears: Facebook\Exceptions\FacebookSDKException: Cross-site request forgery validation failed. Required param "state" missing from persistent data.

This is solved via popup because it makes the makeUrl() (which inserts 'state' in persistent), but the url doesn't have 'code' as url param. So one way solves a problem that exists in other way and viceversa.

Halp.

Edit: I used redis to get and set those params with in the facebookPersistence class and it solved it

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c程序不知道为什么得不到结果
    • ¥40 复杂的限制性的商函数处理
    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置