Rails 3 authentication solutions

Ruby on-RailsAuthenticationPluginsRubygemsRuby on-Rails-3

Ruby on-Rails Problem Overview


I poked around StackOverflow and Google, but couldn't find anyone who has put together a comparison of authentication gems or plugins for Rails (I'm looking for something for Rails 3). What authentication solutions are available for Rails 3, which are most popular, and what are the differences between them?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

Ruby toolbox has a list of the most popular ones: http://ruby-toolbox.com/categories/rails_authentication.html

You can see that Devise and Authlogic are definitely the most popular.

Personally I use Devise. It works well with Rails 3, is easily customizable, and makes it very easy to integrate Twitter and Facebook based auth.

Solution 2 - Ruby on-Rails

For a Rails3 App definitely Devise ;). Devise is the only authentication system which provides security on all the 3 stack layers of rails: - In 'M', 'v', and 'C' and hence the best to go with. But you got to learn more on how to customize devise to custom fit your application's need. You can find help on customizing in this page https://github.com/plataformatec/devise/wiki/_pages

Solution 3 - Ruby on-Rails

In Rails authentication from scratch is dead simple to do. Ryan Bates covers this here http://railscasts.com/episodes/270-authentication-in-rails-3-1

Solution 4 - Ruby on-Rails

Solution 5 - Ruby on-Rails

I am surprised OminAuth did not get a mention in any of the answers. (Agreed OmniAuth is more recent than this question is, but there are answers that came after)

Undoubtedly, this is the most exhaustive authentication solution available currently for rails applications.

Under the hood, OmniAuth uses OAuth2, which is evolving as the de-facto standard for authentication in web applications across platforms and frameworks. Almost all major internet players support OAuth2 - Github, Google, Facebook, Twitter, LinkedIn are just a few to name.

Of course, Devise works very well with OmniAuth so It should not be a major headache for those already using Devise

Solution 6 - Ruby on-Rails

I'm a big proponent of rolling your own. Depending on your requirements its fairly straight-forward and reduced dependency on a key component. Rails 3.1 makes it even easier.

Solution 7 - Ruby on-Rails

Kinda late to the party, but I wrote something up for it here:

http://zergsoft.blogspot.jp/2012/08/rails-3-authentication-compared-warden.html

I cover Warden, Devise and home grown.

Solution 8 - Ruby on-Rails

The tutorial by Michael Hartl is great for learning how to set up your own.

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

I have used that on multiple apps and love the flexibility of setting up my own Authentication Method.

Though for the most part I use Devise and LOVE it. It is very quick/easy to implement, very secure, and does exactly what I need it do.

https://github.com/plataformatec/devise

I will typically use it in conjunction with CanCan and Rolify

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjrdiokoView Question on Stackoverflow
Solution 1 - Ruby on-RailsmikeView Answer on Stackoverflow
Solution 2 - Ruby on-RailsHemanthView Answer on Stackoverflow
Solution 3 - Ruby on-RailsjamescView Answer on Stackoverflow
Solution 4 - Ruby on-RailsthenengahView Answer on Stackoverflow
Solution 5 - Ruby on-RailsLitmusView Answer on Stackoverflow
Solution 6 - Ruby on-RailsloneaggieView Answer on Stackoverflow
Solution 7 - Ruby on-RailsjpgeekView Answer on Stackoverflow
Solution 8 - Ruby on-RailsrickbView Answer on Stackoverflow