1

For start here is whats i'm using : Codeigniter 3 and darkwhispering/facebook-sdk-codeigniter who is a facebook sdk library for codeigniter.

To login with facebook on my app I generate a login url and I redirect the user on this url. It works fine on local and also on my website.

The issue is when a add my app on a facebook tab using this url :

https://www.facebook.com/dialog/pagetab?app_id=myid&redirect_uri=https://myurl.url/

I see my app on a page tab but when I try to click on the login url inside the iframe I get a blank page and there is this message on the javascript console :

Load denied by X-Frame-Options: https://www.facebook.com/v2.6/dialog/oauth?client_id=xxxxxxx&state=xxxxxxxx&response_type=code&sdk=php-sdk-5.4.4&redirect_uri=https://myurl.url/&scope=email does not permit framing.

I understand that facebook block there website to show inside an iframe but I don't understand how I login with the Facebook PHP SDK inside an iframe then ?

Any Idea ? Thanks !

1 Answers1

0

I understand that facebook block there website to show inside an iframe but I don't understand how I login with the Facebook PHP SDK inside an iframe then ?

You need to open the login dialog in the top window instance.

target="_top" if you are using a link to trigger login, resp.
top.location.href="…" if you are redirecting there using JavaScript.

Or, you embed the JS SDK, and use FB.login - that makes for a much nicer user experience, because it does not need to redirect away from the current Facebook page, but will show the login dialog in an overlay.

CBroe
  • 91,630
  • 14
  • 92
  • 150