Rails 3.2 + Devise 2.1 + OmniAuth + Backbone.js Authentication

I am currently using Devise 2.1 + Rails 3.2.x to authenticate users. I am also going to add OmniAuth-Facebook and Twitter support.

I wanted to use this existing infrastructure with Backbone.js. Can you tell me if this is the right workflow in terms of authentication?

  • User Login via Devise (or OmniAuth)
  • Use Autodesatable tokens to return a token?
  • The backbone platform for accessing the token somehow adds that, as part of the API call? I don't need an API to create a user that is being processed by Devise.

Questions: 1. This is how you implement it? 2. Any suggestions / code examples for # 2 and # 3? 3. How would you handle this permission? I do not think CanCan will work.

PS I read a lot of articles, including: http://jessewolgamott.com/blog/2012/01/19/the-one-with-a-json-api-login-using-devise/ . They seem to focus on authentication using the API, rather than providing API resources after authentication is complete.

+5
source share
2 answers

Actually, I got this a little easier:

Devise/OmniAuth, , Devise REST API, , / .

P.S. RABL API Rails.

+2
  • .
  • interwebs, , .
  • . Backbone.sync, jQuery, confuugure jQuery .

, , . . , , .

0

All Articles