画布授权错误 191
我正在尝试在 Facebook 上实现一个画布页面。 Canvas教程说我应该将redirect_url设置为canvas页面:
http://apps.facebook.com/<appName>
但是,当我这样做,得到错误 191。如果我将其设置为画布 url http://www.
,那么我会丢失 Facebook 界面,因为它会打开在“顶部”窗口。实现此功能的正确方法是什么?这是 Facebook 的错误吗?
I'm trying to implement a canvas page on facebook. The Canvas tutorial says that I should set the redirect_url to the canvas page:
http://apps.facebook.com/<appName>
However, when I do that, I get error 191. If I set it to the canvas url http://www.<mysite>.com/fbCanvas
instead, then I lose the Facebook interface, since it opens in the "top" window. What's the correct way to implement this functionality? Is this a bug with Facebook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,我这样解决了:
打开 FBUtils.php 并转到第 94 行,它显示
将其替换为
仅此而已,您将无法离开 FB 和您的应用程序将在 iframe 内!
I had the same problem, and I solved it this way:
Open
FBUtils.php
and go to line 94, it readsreplace it by
and that's all, you won't get off of FB and your app will be inside the iframe!
这不是正常行为,您的画布页面可能正在执行某些操作来摆脱 Facebook 框架,例如使用 Javascript 设置 window.top.location 等。
This is not a normal behavior, your canvas page may be doing something to get rid of the Facebook frame, like setting window.top.location with Javascript etc.
redirect_url 用于在身份验证过程后重定向用户。您不能使用 Facebook 页面作为重定向目的地。 redirect_url 必须与原始画布页面位于同一域中。然后,您可以在身份验证过程后将用户从您的域重定向到相关的 Facebook 页面。
1,apps.facebook.com/appName 一直运行,直到您将用户重定向到 FB AUTH 流程页面
2,FB AUTH 页面将用户(在身份验证流程之后)重定向到 http://www.mysite.com(您应该在这里实现身份验证)
3,您应该将用户重新定向到 apps.facebook.com/appName 返回
此流程最灵活,但是一点如果您有多个画布访问点(选项卡或网页),则很难处理。
The redirect_url is used to redirect users after the auth process. You can not use facebook page as redirect destination. The redirect_url must be in same domain as your original canvas page. Then you can redirect the user after the auth process from your domain to the relevant facebook page.
1, The apps.facebook.com/appName running until you redirect user to FB AUTH process page
2, FB AUTH PAGE redirect the user (after the auth process) to http://www.mysite.com (you should implement the Authentication here)
3, You should reidrect the user to apps.facebook.com/appName back
This flow the most flexible, but little bit difficult to handle if you have more than canvas access point (tab, or webpage).