Ember Authentication

86 views
Skip to first unread message

Bruce Hubbard

unread,
Mar 6, 2014, 4:25:47 PM3/6/14
to cin...@googlegroups.com
I find myself on an Ember project (not sure how that happened!) where another developer has half rolled an authentication mechanism using Ember Simple Auth and DoorKeeper (Rails on the server side).  I was curious if anyone else has tackled auth in Ember especially using Rails on the server side.  Are there any other libraries/etc that are easier than that combination? Just curious what other people are using.

Wesley Workman

unread,
Mar 6, 2014, 10:44:01 PM3/6/14
to cin...@googlegroups.com
Hey Bruce --

We've tackled auth in our app at Batterii. Our solution was unconventional and has been replaced by alternate options in Ember native. 

I think the most modern solution for handling this I've seen is making an `Authenticated` route class that takes advantage of Ember.Route's `beforeModel` to conditionally. There is a good example in this gist: https://gist.github.com/machty/5647589 (see: "authenticated route"). The premise is that any route that requires a user to be logged in would extend your `Authenticated` route and automatically check credentials.

I'm happy to see more folks getting into Ember. If you have any questions or even want to pair for a day to get up to speed on stuff, I'm more than happy to help.


-- Wesley 

Kevin Rockwood

unread,
Mar 7, 2014, 9:10:27 AM3/7/14
to cin...@googlegroups.com
In the ember app I'm working on now, the sign-in form as just a static rails view. After the user signs in we bootstrap a current user object `App.currentUser = Ember.Object.create(<%= current_user.to_json %>)` and reference that in our app. You can also authenticate over via json and expose an endpoints like /api/me to get the current user. Hope that helps.

-Kevin


--
You received this message because you are subscribed to the Google Groups "Cincinnati JavaScript User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cincijs+u...@googlegroups.com.
To post to this group, send email to cin...@googlegroups.com.
Visit this group at http://groups.google.com/group/cincijs.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages