doushui3061 2017-04-06 02:26
浏览 93
已采纳

Facebook重定向URI登录产品

I've been including the "login with facebook" product wich allows you to get users information based on their facebook's account email.

So when I try to redirect after the users accept my app on facebook, it redirects to my homepage, not to the redirect url I specified on the getLoginUrl() method.

My code is as follows:

$fb = new Facebook([
      'app_id' => "my app id",
      'app_secret' => "my secret",
      'default_graph_version' => 'v2.2'
      ]);

$helper = $fb->getRedirectLoginHelper();

$permissions = ['email'];

$loginUrl = $helper ->getLoginUrl('http://127.0.0.2/alumn-e/pages/facebookcallback/', $permissions);

$this->set('urlfacebook',$loginUrl);

These are my allowed redirection URIs:

enter image description here

For some reason my users are redirected to http://127.0.0.2/alumn-e/#= when they accept the conditions on the use of my app, when I was expecting to get a redirection to http://127.0.0.2/alumn-e/pages/facebookcallback/.

Ive been searching on google lots of time and I cant understand why.

Thanks everyone in advance!

EDIT: Ive included error_reporting on my function and I've done the process of logging on fb and it doesnt show anything on the console..

  • 写回答

1条回答 默认 最新

  • dtt27783 2017-04-10 09:28
    关注

    I discovered this was a mistake on my facebook callback function so thanks to everyone! I finally understood this and I used v2.8 finally.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部