Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook canvas: Refused to display app in a frame because it set 'X-Frame-Options' to 'DENY'

I'm trying to get my app to work in Facebook canvas. To the moment, I successfully log-in to facebook, but after that, I need to redirect my app so I can get the user to be logged in my app.

When trying to do this what I get is:

Refused to display 'https://www.facebook.com/dialog/oauth?scope=email%2Cpublish_actions&state=7…edirect_state%3D7EdHoAcZYlnIaURuz1YI8sbRhxhBg2iM&client_id=420498651348242' in a frame because it set 'X-Frame-Options' to 'DENY'.

How can I overcome this restriction from Facebook?

like image 523
Sascuash Avatar asked Oct 01 '22 11:10

Sascuash


1 Answers

To redirect you must add to that string the redirect_uri parameter.

But it looks like you are trying to open the fb login page inside the canvas. You can't show the facebook login page inside an iframe. It's not allowed, and thats what X-Frame-Options=DENY means. You should use the fb popup log in.

See the display option: https://developers.facebook.com/docs/reference/dialogs/oauth/

I hope this will help.

like image 165
Bruno Avatar answered Oct 13 '22 11:10

Bruno