简体   繁体   English

Facebook OAuth redirect_uri问题'应用程序配置不允许使用URL。'

[英]Facebook OAuth redirect_uri problem 'Given URL is not permitted by the application configuration.'

When asking for authorisation by redirecting to the following url: 通过重定向到以下URL请求授权时:

https://graph.facebook.com/oauth/authorize?client_id=...&scope=email,offline_access&redirect_uri=http%3A%2F%2Flocalhost%2Flogin%2Findex.php%3Fcallback%3Dfacebook

Facebook returns 'Invalid redirect_uri Given URL is not permitted by the application configuration.' Facebook返回'无效的redirect_uri应用程序配置不允许给定URL。'

Possibly because my application is registered with 可能是因为我的申请已注册 http://syncacity.com on the application configuration. 关于应用程序配置的http://syncacity.com But still, twitter allows me to redirect to any url, so why is facebook whining? 但仍然,Twitter允许我重定向到任何网址,那么为什么facebook抱怨?

I'd appreciate your thoughts :) 我很感激你的想法:)

为什么不只是编辑您的hosts文件并将您的域指向您的本地IP,那么您只需要在执行任何操作之前切换开发盒主机。

Change your application url to http://localhost while you develop and then to your site once it's in production. 在开发时将应用程序URL更改为http:// localhost ,然后在生产时将其更改为您的站点。 :) :)

it got resolved - thanks to one of the Facebook platform developers. 它得到了解决 - 感谢Facebook平台开发人员之一。

Let's say your local site URL is http://localhost:8000 You will need to add http://localhost:8000 to the Facebook App setting at "Settings -> Basic -> Website->Site URL." 假设您的本地站点URL为http:// localhost:8000您需要在“设置 - >基本 - >网站 - >站点URL”的Facebook应用程序设置中添加http:// localhost:8000

Following worked for me: 以下为我工作:

App Domains: localhost
Site URL: http://localhost

在此输入图像描述

我以沙箱模式(高级设置)创建测试应用程序,然后集成到开发和测试中

您已在redirect_url中定义了localhost网址(redirect_uri = http://localhost/login/index.php ..)我不熟悉OAuth,但这可能是问题所在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM