如何为通过粉丝页面选项卡访问的 Facebook 应用程序显示 OAuth 对话框?
我正在开发一个 Facebook 应用程序作为页面选项卡应用程序。我想在用户通过粉丝页面访问应用程序之前显示 OAuth 对话框。我该怎么做?
对于画布应用程序,当我从应用程序设置(增强型身份验证对话框)启用 OAuth 对话框时,通过 apps.facebook.com/myapp
访问应用程序时会显示 OAuth 对话框。我使用添加在粉丝页面内的页面选项卡访问同一应用程序,但未显示 OAuth 对话框。
I'm developing a Facebook application as a Page Tab App. I want to show the OAuth dialog box before the user access the application via the fan page. How can I do this?
For a canvas app, when I enable the OAuth dialog box from the application settings (Enhanced Auth Dialog) the OAuth dialog box is shown when the application is accessed via apps.facebook.com/myapp
.But when I access the same application using the page tab added inside a fan page, the OAuth dialog is not shown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅教程Canvas 教程。
关键技巧是您需要定位“_top”窗口(iframe 外部)...例如,
或者
据我所知,您无法在 iframe 内部完成此授权流程。
我还建议观看来自 Facebook 的短视频身份验证:概述开发商车库:巴黎(2011-03-29)。
如果您想请求身份验证(或在身份验证后添加一些额外的权限),请参阅两个 JavaScript SDK 函数,FB.getLoginStatus 和 FB.login。请注意,
FB.login
会启动一个弹出窗口 - 因此它必须由用户click
事件触发(否则某些浏览器会阻止弹出窗口)。此方法的好处是它不需要页面重定向 - 弹出窗口会传回响应而无需重新加载。See the tutorial Canvas Tutorial.
The key trick is that you need to target the "_top" window (outside of the iframe)... For example,
or
To my knowledge you can not complete this authorization flow inside of the iframe.
I also recommend watching the short video Authentication: An Overview from Facebook Developer Garage: Paris (2011-03-29).
If you want to request authentication (or add on some additional permissions after authentication) see the two JavaScript SDK functions, FB.getLoginStatus and FB.login. Take note that
FB.login
launches a popup window - so it must be triggered from a userclick
event (or some browsers will block the popup). The benefit of this method is it doesn't require page redirects - the popup communicates back the response without a reload.