criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 176 forks source link

Auth redirects in a canvas app #26

Closed jmagnuss closed 11 years ago

jmagnuss commented 11 years ago

When using the sample authentication code in a Fb canvas app, doing res.redirect(authUrl) results in this:

Refused to display 'https://www.facebook.com/dialog/oauth?...' in a frame because it set 'X-Frame-Options' to 'DENY'. about:blank:1

In various posts it looks like we need to redirect the browser top to the oauth, we can't do it within an iframe loaded from Facebook.

Has anyone else run into this?

jmagnuss commented 11 years ago

So far, this works: res.send('');

allannaranjo commented 11 years ago

You have to:

top.location.href = "/auth/facebook";