darksky
darksky

Reputation: 21019

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?

Upvotes: 5

Views: 2462

Answers (1)

Chris
Chris

Reputation: 824

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

Upvotes: 5

Related Questions