Click here to Skip to main content
15,886,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want login into my application using FB.Login() function , but function is not working because of following error

x- frame not allow facebook error

What I have tried:

I tried many thing not able to get any success
Posted
Updated 30-Jul-20 5:07am
Comments
ZurdoDev 30-Jul-20 11:07am    
If you posted the exact error it would be helpful; however, google has tons of results that you should be looking through.

1 solution

Refer the facebook community thread on similar usecase: x-frame-options Deny Error in Facebook login when iframed by Facebook[^]

UPDATE:
Refer: Refused to display [url] in a frame because it set 'X-Frame-Options' to 'deny' · Issue #546 · jeduan/cordova-plugin-facebook4 · GitHub[^]

Quote:
Debugging the Facebook sdk i have found the problem seems to be that when inAppBrowser is installed the Facebook sdk detects that we are on a mobile phone even when running from a browser. (I assume inAppBrowser is responsbible for the change of navigator.UserAgent that happens)

Using Chrome Developer tools to force the navigator.UserAgent to be fixed to the Chrome UserAgent in fact made all work, but that is of course not a proper solution

As I need inAppBrowser to open legal documents etc I could not just remove it, but the is a way to avoid using inAppBrowser when on a browser or probably also only when performing tasks like login

At the top of my app before loading any plugins you can save window.open like this

var original_open = window.open;

then later before you active login or if you want to after detecting we are on a browser you can do something like

if (!this.isApp) {
window.open = original_open;
}

So basically the error message is because the platform is being detected wrongly
 
Share this answer
 
v2
Comments
Akshay malvankar 30-Jul-20 23:05pm    
no i go through this doc also but nothing is there in this docs,so can anybody help me on this, why it give this error ??
Sandeep Mewara 30-Jul-20 23:10pm    
What's the exact error you get?
Akshay malvankar 30-Jul-20 23:40pm    
it giving me following error "Refused to display 'https://www.facebook.com/connect/xd_arbiter/r/iPrOY23SGAp.js?version=42#channel=f3ad0f3d3435548&origin=https%3A%2F%2Fmakshay.sevenpv.com' in a frame because it set 'X-Frame-Options' to 'deny'." becasue of that i am not able to execute FB.getLoginstatus() function
Akshay malvankar 31-Jul-20 6:23am    
guys doesnt reslove the error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900