I am messing about with Node for the 1st time and have an API set up which can authenticate users with local and facebook.
I now want to get my ember app using the /auth/facebook auth on the API - all hints are pointing at ember-simple-auth for doing this but I haven’t got a clue where to begin! I have looked at the docs and understand it all hangs off of the session object but there doesn’t seem to be much info in the way of actually authenticating a user with something like Passport.
Has anyone done this? Are there any examples anywhere?
I did work on a small blogging application a while ago that used ember-simple-auth against an API using Node-Passport.
From what I remember from looking at the code, one of the easiest ways to accomplish this is by implementing your own Authenticator and Authorizer with ember-simple-auth. The README on their GitHub and API docs do well to explain most of it …
Basically the Authenticator is in charge of three main repsonsibilities; authenticating a session, restoring a session and invalidating a session. That is pretty much where you want to implement your AJAX between your ember app and your API auth points.
The authorizer comes into play afterwards by using whatever token data you received from authenticating to wrap subsequent requests with token data to maintain authenticity.
torii - use facebook connect to get the access_token stuff else you’re in a world of pain - only downside here is it doesn’t work with mobile - I am yet to figure this out.