Facebook 访问令牌图 API 调用导致错误的请求错误
我们有一个 Canvas Facebook 应用程序,一段时间以来,一些尝试安装(允许)我们的 Facebook 应用程序的用户收到了一个奇怪的错误。我提到这种情况仅发生在部分用户身上,而不是所有用户!我们收到的错误是“远程服务器返回错误:(400) 错误请求。”我们将图形 API 调用放入 try catch 块中,这就是当我搜索日志以查看出了什么问题时日志中显示的内容。图形 API 调用为: https://graph.facebook.com/oauth/access_token?client_id=XXX&redirect_uri=XXX&client_secret=XXX&code=code_received_from_facebook。
我们从 Facebook 收到了代码,并将其附加到上面的图形 API 调用中,但对于某些用户来说,这似乎不起作用。我们的redirect_uri参数包含我们的Facebook应用程序的URL,还包含一些参数(例如:http://apps.facebook.com/our_application_URL?cid=xxx&surveyid=xxx&messageid=xxx)。 xxx = 一些值。
你们中有些人遇到过这种奇怪的行为吗?对某些用户有效但对其他用户无效?我们使用相同的代码,因此成功安装和不成功安装之间没有任何变化。
提前感谢您的帮助!
We have a Canvas Facebook App and for some time we get a strange error for some of the users that are trying to install (allow) our Facebook app. I mention this is happening only for some of the users and not for all! The error we are getting is "The remote server returned an error: (400) Bad Request." The graph API call we putted in a try catch block and this is what the logs says when I searched over them to see what went wrong. The graph API call is:
https://graph.facebook.com/oauth/access_token?client_id=XXX&redirect_uri=XXX&client_secret=XXX&code=code_received_from_facebook.
We received the code from Facebook and append it to the graph API call from above but it seems that for some users this is not working. Our redirect_uri parameters contains an URL to our Facebook App and contains also some parameters (example: http://apps.facebook.com/our_application_URL?cid=xxx&surveyid=xxx&messageid=xxx).
xxx = some values.
Did some of you confront with this kind of strange behavior? Working for some users but for other is not working? We are using the same code so nothing change between a successful installation and a unsuccessful installation.
Thank you for your help in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
既然 Facebook 要求应用程序使用 SSL,您的“redirect_uri”需要为 https(即 https: //apps.facebook.com/myapp/),否则您将收到“错误请求”。
您可能只有强制使用 SSL 的用户才会收到错误消息,而其他用户则不会收到该错误消息。
Now that Facebook require SSL for applications your "redirect_uri" need to be https (i.e https://apps.facebook.com/myapp/), otherwhise you will get "Bad Request".
You probably got the error for only the users that had forced SSL but not the rest.