facebook OpenGraph API on Rails (FBGraph)
我正在尝试使用 FBGraph 让我的应用程序在用户墙上发布消息。然而,所有 API 对我来说都有点陌生,我只是试图改变一些事情,看看会发生什么。现在,我收到此错误消息
{
"error": {
"type": "OAuthException",
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration."
}
}
有人知道redirect_uri是什么意思吗?我的 Facebook 应用程序设置页面上会显示什么?
I am trying to use FBGraph to let my app publish messages on the users wall. However, all of the APIs are kind of foreign to me and I am just trying to change things and see what happens. Right now, I am getting this error message
{
"error": {
"type": "OAuthException",
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration."
}
}
Does anyone know what it means by redirect_uri? What would it be on my Application Settings page on facebook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
弗罗林是正确的。这里请注意..在本地测试时,您需要将其设置为:
http://localhost:3000/ (或无论您的应用程序服务器端口是什么)
然后,当您将其移至生产环境时,将其设置为常规 URL:
http://yourdomain.com /
我有一个单独的 Facebook 应用程序,我在开发中使用它来进行测试,因此我不必在它们之间来回更改,并且我在设置文件中设置了密钥,其中包含用于开发的令牌和生产应用程序。
不管怎样,看起来你已经快到了。它至少返回到回调 URL。更新 facebook_connect URL 后应该没问题
Florin is correct. Just a note here.. when testing locally you will need to set it to:
http://localhost:3000/ (or whatever your app server port is)
Then when you move it to production, set it to your regular URL:
http://yourdomain.com/
I have a separate facebook app that I use in development to test, so I don't have to change back and forth between them and I set up the keys in a settings file, which has my tokens for development and production apps.
Anyways, looks like you are almost there. It is making it back to the callback url at least. Should be fine once you update the facebook_connect URL
我不是 Facebook 专家,但几个小时前,当我尝试使用 Facebook 登录 Web 应用程序内的用户时,我遇到了与您完全相同的问题。
看来您在调用“https://graph.facebook.com/oauth/ 时指定的redirect_uri授权”必须与应用程序的连接 URL 位于同一域中。 (您可以从应用程序设置中的“连接”部分设置该连接 URL)
此致,
弗罗林
I am not a facebook expert, but I hit the exact same problem as you a few hours ago when I was trying to login a user inside a web application with Facebook.
It seems that the redirect_uri which you specify in your call to "https://graph.facebook.com/oauth/authorize" must be on the same domain as the Connect Url of your application. (you can set that connect url from the Connect section in your application's settings)
Regards,
Florin
可能需要检查您的设置>基本>基本信息>应用程序域。我相信也需要为redirect_uri 设置正确的帽子。
May need to check your Settings > Basic > Basic Info > App Domain. I believe hat needs to be set correctly for the redirect_uri as well.
我有同样的问题。
就我而言,我在 facebook 上配置了站点 url 为:“http://localhost:3000”,这是 facebook 的错误 URL。
原因是 url 末尾缺少 /,所以正确的站点 url 应该是:
“http://localhost:3000/”
I had the same issue.
In my case, I had configured site url on facebook as: "http://localhost:3000", it was a wrong URL to facebook.
The reason is, it lack of the / in the end of url, so the correct site url should be:
"http://localhost:3000/"
只需验证您的“应用程序 ID”即可。就我而言,我遇到了这个问题,因为我正在使用我正在从事的其他项目的 ID。相当明显,但我损失了一些时间。
Just verify your 'Application ID'. In my case I had that problem because I was using ID from my other project that I was working on. Fairly obvious but I lost some time.
我必须确保我也有范围:
另外,您确实需要确保等待几分钟,因为传播确实需要时间..
I had to make sure I had the scope in there too:
Plus you really need to make sure you wait a couple of minutes because it does take time to propagate..