Sascuash
Sascuash

Reputation: 3831

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?

Upvotes: 5

Views: 9246

Answers (1)

Bruno
Bruno

Reputation: 115

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.

Upvotes: 4

Related Questions