使用严格模式的Facebook登录获取重定向URI [英] Facebook Login with Strict Mode for Redirect URIs

查看:142
本文介绍了使用严格模式的Facebook登录获取重定向URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Codeigniter 3,Facebook SDK和此此库 >用于管理请求。

I'm developing a WebApp with Codeigniter 3, Facebook SDK and this this library for manage the request.

使用Facebook的主教程登录,一切正常。此处的示例:

Using the main tutorial for Facebook Login all things work fine. An example here:

<?php $login = $this->facebook->login_url(); ?>
<a href="<?=$login;?>"> Login with your Facebook account </a>

之后,我可以使用访问令牌进行任何请求。

After that I can do any request with the access token.

使用新更新,facebook应用程序必须激活严格URI重定向模式。因此,在开发人员门户中,我已经这样激活了我的网址:

With the new update, facebook apps must activate the Strict Mode for Redirect URIs. So in the developer portal I've activated my urls like this:

http://localhost/home/login

但是当我尝试登录时,Facebook的回复是

But when I try to log in, facebook response with

http://localhost/home/login?code=SOME_STRING_HERE&state=SOME_STRING_HERE#_=_

没有任何访问令牌或有效会话。

without any access token or valid session.

我跳过任何步骤吗?

使用相同的代码,禁用重定向URI的严格模式,所有工作正常精细。

With the same code, disabling Strict Mode for Redirect URIs all things work fine.

谢谢

推荐答案

在为重定向URI模式启用严格模式后,当我尝试使用Facebook登录时,尽管我指定了重定向URL,但我开始收到图形返回了错误:无法加载URL:此URL的域未包含在应用程序的域中错误​​。从图sdk v4升级到图sdk v5后,错误消失了。

After I enabled Strict Mode for Redirect URIs mode, when I try to login using facebook I started getting "Graph returned an error: Can't Load URL: The domain of this URL isn't included in the app's domains" error eventhough I specified redirect urls. After upgrading from graph sdk v4 to graph sdk v5 error is gone.

这篇关于使用严格模式的Facebook登录获取重定向URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆