

Ask HN: Authentication with Angular/Rails? - pastagami

I know there are many companies developing with Angular and Rails (and many looking to hire for this as well).<p>How are you managing authentication (securely)?
======
mtmail
This sounds like a specific question how to solve a problem in one programming
language. Wouldn't a question on stackoverflow be better?

(Afaik most Rails projects use
[https://github.com/plataformatec/devise/](https://github.com/plataformatec/devise/)
which takes care of database setup, password hashes, session cookies, even
forgot-password feature and Facebook/Twitter/Google+ logins.)

------
pairing
Angular and Rails are frameworks that leave the decision of authentication up
to you.

You can do token authentication, basic authentication, OAuth, OAuth2, or even
roll your own. For a rails api <-> angular combo, I usually stick to token or
OAuth 1/2 authentication.

I have open sourced an angular application (technically ionic but it uses
angular under the hood) and the rails api that it uses as a backend which uses
token authentication.
[https://github.com/johnkelly/mojave](https://github.com/johnkelly/mojave)
[https://github.com/johnkelly/kalahari](https://github.com/johnkelly/kalahari)

------
kdlmm
I like using Token based authentication + HTTPS. Using Rails (or nodejs, or
whatever you want) and redis to store the tokens on the back-end. Here's an
article about it: [http://www.kdelemme.com/2014/03/09/authentication-with-
angul...](http://www.kdelemme.com/2014/03/09/authentication-with-angularjs-
and-a-node-js-rest-api/)

Disclaimer: I'm the author.

------
sanemat
I use cookie based authentication, like houndci.com
[https://github.com/thoughtbot/hound](https://github.com/thoughtbot/hound) I
think token based authentication (rails-api) is better, but most of my
technical background is rails.

------
joshschreuder
Check out Satellizer, it has token + OAUTH authentication for Angular.
[https://github.com/sahat/satellizer](https://github.com/sahat/satellizer)

------
tehwebguy
This looks promising
[https://github.com/cloudspace/angular_devise](https://github.com/cloudspace/angular_devise)

------
orky56
Are there any gems/methods that combine authentication along with multitenancy
in a turnkey solution? (Devise + Apartment)

