在IFrame中使用Facebook连接(不是Facebook中的Iframe) [英] Using Facebook connect inside an IFrame (Not an Iframe inside facebook)

查看:138
本文介绍了在IFrame中使用Facebook连接(不是Facebook中的Iframe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在IFrame中使用Facebook连接。看来,在用户完成验证并授予我的应用程序权限后,Facebook Cookie不会保存在浏览器上。

I'm trying to use Facebook connect in an IFrame. It seems that after the user finishes authenticating and granting my app permissions the Facebook cookies aren't saved on the browser.

1)用户按下Iframe中的连接按钮。

1) The user presses the connect button inside my Iframe.

2)用户通过FB Connect进行身份验证。

2) The user is authenticate with FB Connect.

3)用户为我的应用程序授予权限。

3) User grants permissions for my app.

4)iframe页面被刷新,但服务器端API仍然不返回用户 - Facebook cookie不在浏览器中(我认为这是问题)

4) The iframe page is refreshed, but the server side API still doesn't return a user-The Facebook cookies aren't in the browser (I think that's the problem)

5)服务器再次显示已注销的页面,FB Connect JavaScript将用户标识为已注销。

5) Server displays the logged out page again and the FB Connect JavaScript identifies the user as being logged out.

6)在某些浏览器上,刷新IFrame内容可解决此问题。

6) On some browsers, refreshing the IFrame content fixes this issue.

如果我在自己的窗口中加载iframe网址,工作。

If I load the iframe url in its own window, outside of the iframe, everything works.

我一直试图解决它两天了。请帮助!

I've been trying to solve it for two days now. Please help!

感谢

推荐答案

Facebook有javascript代码最少在api相关页面),检查它是否被加载在iframe和禁用页面。我认为这是为了防止点击劫持。

Facebook has javascript code (at least in the api-related pages) that checks whether it's being loaded in an iframe and disables the page. I think this is to prevent clickjacking.

Facebook不想让你做你想做的事。请改用弹出式窗口。

Facebook doesn't want you to do what you're trying to do. Use a popup window instead.

这篇关于在IFrame中使用Facebook连接(不是Facebook中的Iframe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆