Skip to content

Conversation

@bigokro
Copy link
Contributor

@bigokro bigokro commented Apr 21, 2012

I added changes to facebook.js to support Facebook Canvas apps:

http://developers.facebook.com/docs/appsonfacebook/tutorial/

This is related to issue #146 (#146)

This version requires two new configurations:

  • canvasPath: the server path that Facebook will post to when a user goes to your app (what you configure as Canvas URL in Facebook, minus the hostname). Analogous to entryPath.
  • canvasPage: the URL that users use to access your app on Facebook, configured as Canvas Page in Facebook.

There are several "to-do's" in here:

  • Make "/auth/facebook/canvas" the default canvasPath
  • Validate the signed_request that comes from Facebook for security reasons
  • Support querystring data on the canvas page (I'm not sure yet what is needed here, so I haven't bothered)

@bnoguchi
Copy link
Owner

Thanks for your pull request. I think we ought to make this a separate module called facebookCanvas. You can inherit from the facebook module to do this via:

everyauth.facebook.submodule("facebookCanvas")
  .configurable({canvasPage: "..."})
  // Your other extensions follow with the
  // same chained method calls in your pull request

, placing this code under modules/facebookCanvas.js

@bnoguchi
Copy link
Owner

And don't forget to update the README for the pull request. Thanks!

@bigokro
Copy link
Contributor Author

bigokro commented Apr 22, 2012

Ok, thanks for the feedback. I have my hands pretty full these days, so I can't predict how long it will take me to make it production-ready, but I'll keep you up to date.

As for the signature validation, are you using any specific library for SHA hashing? Is there one you'd accept adding as a dep to the project?

@bnoguchi
Copy link
Owner

Node has a built-in crypto module. See the following for docs and an example:

@bigokro
Copy link
Contributor Author

bigokro commented Apr 22, 2012

Perfect! Thanks!

@bigokro
Copy link
Contributor Author

bigokro commented Apr 27, 2012

I'm starting to get back to this. I was able to implement the crypto part, so thanks again for the tip.

About the everyauth submodule recommendation: looking at the other modules, I see that none of them are importing "everyauth". Instead, they are using everymodule. Is that what you meant?

@bigokro
Copy link
Contributor Author

bigokro commented Apr 28, 2012

Give it a try. I've taken care of all the todo's, and moved it to a separate submodule.

bnoguchi added a commit that referenced this pull request Aug 8, 2012
Rudimentary support for the Facebook Canvas
@bnoguchi bnoguchi merged commit 89d4e83 into bnoguchi:master Aug 8, 2012
@bnoguchi
Copy link
Owner

bnoguchi commented Aug 8, 2012

Thanks, finally merged this in.

@fabriziomoscon
Copy link

@bnoguchi I was wondering if there is any reason why the facebook canvas module hasn't been included in the express-3 branch. We tried to use it in a project and it seems to work correctly. Is there any design choice to remove it or is it something that can be added?

@efecan
Copy link

efecan commented Mar 19, 2013

@fabriziomoscon I was wondering the same thing for about a month or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants