Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Rails authentication system is better: AuthLogic, Clearance, or Devise?

I'd like to implement a third-party Ruby on Rails authentication system that is actively developed and carries sensible defaults.

I've narrowed down my selection to AuthLogic and Clearance (thoughtbot) -- can anyone sway me in either direction? In terms of requirements, both would work for my project from what I can tell. It looks like documentation/code samples in both are fairly similar, and both are relatively easy to setup.

Anyone have a preference? I really like AuthLogic's OpenID plugin -- don't know if Clearance can do that.

like image 699
Trent Scott Avatar asked Apr 25 '11 22:04

Trent Scott


3 Answers

Devise for sure :)

https://github.com/plataformatec/devise

like image 125
Spyros Avatar answered Oct 17 '22 21:10

Spyros


I have used the restful_authentication gem, authLogic and Devise and I like devise 'cos it's model based (higher up the stack is better and easier to rspec) and also lets you just put in an admin flag in the user table for admins and go with that (or use roles for more complex stuff).

Another gem that has become common with devise is cancan for roles, e.g. admin, reader, manager, etc (whatever you want) with syntax like below (from the cancan gem).

<% if can? :update, @article %>
  <%= link_to "Edit", edit_article_path(@article) %>
<% end %>
like image 23
Michael Durrant Avatar answered Oct 17 '22 21:10

Michael Durrant


Did you already rule out Devise for some reason?

If not, it's the most current and complete authentication framework for Rails. As for openID authentication, take a look at OmniAuth, which integrates seamlessly with devise.

like image 2
Adam Rubin Avatar answered Oct 17 '22 19:10

Adam Rubin