OAuth dialog doesn't work inside Facebook ifra

2019-05-29 04:21发布

问题:

The page is question is https://apps.facebook.com/gentlemensbet/ The 'Begin Betting' button won't load the oauth screen for anyone.

However, if you open it in a new window, it seems to work just fine. I can't find any reasonable explanation for this behavior and don't know how to correct this.

回答1:

Add target="_blank" or target="_top" to your anchor tag. You are trying to load a facebook URL in an iframe within a facebook page. That isn't permitted.

Refused to display document because display forbidden by X-Frame-Options.

is the error logged in the console. It is a preventive measure against click-jacking.

Your link should be:

<a class="btn btn-large btn-primary" href="https://www.facebook.com/dialog/oauth?..." target="_blank"></a>