Refused to display document because display forbidden by X-Frame-Options

穿精又带淫゛_ 提交于 2019-11-30 10:57:45

I had this problem too, fixed it with: The app was redirecting the user to a login screen from Facebook (auth dialog box), while the user was already logged in. So I changed the code to redirect either to the success page if logged in, or to the dialog box if not logged in.

This is a problem when facebook redirects to your app from a web browser and then you redirect to the facebook authorization sign in. You have to make sure that the form replaces the page and does not load into the facebook canvas as it does not like it.

So you have to do a clean redirect like so -this is node example

res.send("<script> top.location.href='"+ "https://www.facebook.com/dialog/oauth?    
client_id=*********&redirect_uri=http://apps.facebook.com/myapp" + "'</script>");

Look at this facebook dev page and its in step 3

https://developers.facebook.com/docs/howtos/login/server-side-login/

Does not seem to be a problem with mobile apps just desktop

Does this javascript work?

document.write(isFacebookPage()?"YES, I'm in a Facebook Page!":"No, not a Facebook Page");

function isFacebookPage(){
    return (document.location.href.indexOf('/pages/')>0);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!