Facebook apps with canvas not working
Very useful module, but need some tricks if using with facebook apps authentication (i mean using canvas[iframe] page).
two issues:
- when calling faceboom.com/dialog/oauth, we must set redirect_uri to 'CANVAS_PAGE' = apps.facebook.com/[app_name] but for entrypath, it must be http://[my_hostname]/[entry_path]
can not being set like below, causing error=119 not valid redirect_uri everyauth.facebook.entryPath = http://[my_hostname]/entry_path] everyauth.facebook.callbackPath = http://apps.facebook.com/[app_name] because both entryPath and callbackPath construct url by concat myHostname() + entryPath() or callbackPath()
my workaround for this is to hard code redirect_uri but it is not the way it must be.
- because canvas is in iframe, we must call facebook.com/dialog/oauth with top.location.href not just with 303 header.
even for these issues, it still works great for very painful auth coding.
I would make a facebook.canvas boolean and depending on that it overwrites the redirect and concat function.
How does your workaround look like?
-- Express3 Branch --
What is the status of this?
Everything works fine for me when using facebook connect via my main site URL. When I load the site inside an IFRAME canvas app, the oAuth dialog does not appear.
The first time the user authorizes the app, no facebook auth dialog appears and login fails. Retrying fails. If they have registered via the main site URL, login still works successfully, even inside IFRAME.
Is this due to the oAuth redirect not conforming to the fb way?
"Because your application is being loaded in an iframe, returning a 302 to redirect the user to the OAuth Dialog will be unsuccessful. Instead you must redirect by setting the Javascript window.top.location property, which causes the parent window to redirect to the OAuth Dialog URL"
https://developers.facebook.com/docs/authentication/canvas/
Any help would be appreciated, I'd be happy to PR if someone can point me in the right direction.
I see that the express2 branch has .facebookCanvas which sounds like what I need.