最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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 ';state=7…edirect_state%3D7EdHoAcZYlnIaURuz1YI8sbRhxhBg2iM&client_id=420498651348242' in a frame because it set 'X-Frame-Options' to 'DENY'.

How can I overe this restriction from Facebook?

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./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 overe this restriction from Facebook?

Share Improve this question asked Feb 26, 2014 at 12:19 SascuashSascuash 3,84111 gold badges49 silver badges67 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

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./docs/reference/dialogs/oauth/

I hope this will help.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论