Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating Ember App with Rails (and Devise)

Referring to: Ember authentication best practices?

We have two separate apps: a Rails backend/API and a standalone Ember app. The Ember app will speak to the Rails API.

I've found ember-auth (https://github.com/heartsentwined/ember-auth), but I don't understand why I'm going to benefit from it.

Here's what I want to do : - When logging in, Ember sends username and password to my /accounts/login endpoint. - If correct, Rails responds with the authentication token. - Ember will store the authentication token locally and pass it along with each subsequent requests. I do not want my tokens to expire so users can always close the browser, come back, and still be logged in.

Is there any issues with my approach? What about security?

like image 216
darksky Avatar asked Jun 24 '13 06:06

darksky


1 Answers

Take a look at these two Embercasts videos:

Client-side Authentication Part 1
http://www.embercasts.com/episodes/client-side-authentication-part-1

Client-side Authentication Part 2
http://www.embercasts.com/episodes/client-side-authentication-part-2

And this blog post:

Authentication in ember.js
http://log.simplabs.com/post/53016599611/authentication-in-ember-js

like image 68
Chris Avatar answered Sep 28 '22 03:09

Chris