FB.login无效的redirect_uri(xd_proxy.php) [英] FB.login Invalid redirect_uri (xd_proxy.php)

查看:122
本文介绍了FB.login无效的redirect_uri(xd_proxy.php)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我使用的是Facebook JS SDK,但我不断得到191:

现在,我已经检查了我的设置,一切似乎都井然有序. 应用程序域"设置为我的基本域(alehunt.com),并且具有Facebook登录名的网站" =>站点URL:"设置为"http://www.alehunt.com".我没有做任何与画布有关的事情.

当查看FB.login生成的登录对话框窗口的URL时,我很惊讶地看到redirect_uri并不直接指向我的应用程序,而是通过 https://www.facebook.com/dialog/oauth?api_key=MYAPPID&app_id=MYAPP client_id = MYAPPID& display = popup& domain = www.alehunt.com& origin = 1& redirect_uri = http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23cb%3Df2f3026b8%26origin%3Dhttp% 253A%252F%252Fwww.alehunt.com%252Ff298bcee3c%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df3d63e980c& response_type = token%2Csigned_request& scope = email& sdk = joey 有人能对此有所启发吗?为什么JS SDK坚持在重定向URI中设置所有这些设置?

我看到的错误是:

API错误代码:191 API错误描述:指定的URL不属于应用程序 错误消息:无效的redirect_uri:应用程序配置不允许给定的URL.

我正在Chrome 21中进行测试

解决方案

原来,这是由于使用了由Cordova(PhoneGap)修改的Facebook JS客户端.仍然不确定确切的问题是什么,但是当我移至直接从Facebook加载JS时,一切都很好.

So, I'm using the Facebook JS SDK, and I keep getting 191:

Now, I have checked my settings, and everything seems to be in order. App Domain is set to my base domain (alehunt.com), and "Website with Facebook Login" => "Site URL:" is set to "http://www.alehunt.com". I'm not doing any canvas-related stuff.

When looking at the URL for the login dialog window produced by FB.login I'm quite surprised to see that redirect_uri does not point directly to my app, but instead goes via http://static.ak.fbcdn.net/connect/xd_proxy.php. I'm wondering if this is the reason for the 191 error.

Now, if I change that part of the redirect_uri to be my own everything seems to work just fine. The dialog is presented as it should.

The complete URL is https://www.facebook.com/dialog/oauth?api_key=MYAPPID&app_id=MYAPPID&client_id=MYAPPID&display=popup&domain=www.alehunt.com&origin=1&redirect_uri=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23cb%3Df2f3026b8%26origin%3Dhttp%253A%252F%252Fwww.alehunt.com%252Ff298bcee3c%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df3d63e980c&response_type=token%2Csigned_request&scope=email&sdk=joey

Can anyone shed some light on this? Why is the JS SDK insisting on setting all this in the redirect URI?

The error I'm seeing is:

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

I'm testing in Chrome 21

解决方案

Turns out this was due to using a Facebook JS client which had been modified by Cordova (PhoneGap). Still not sure exactly what the issue was, but everything worked just fine when I moved over to loading the JS directly from Facebook.

这篇关于FB.login无效的redirect_uri(xd_proxy.php)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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