views:

1409

answers:

8

What is current state of the art for enabling OpenID login in Ruby on Rails applications? This is a community wiki with up-to-date answers to this question.

Authlogic

The most advanced authentication solution seems to be Authlogic. It supports OpenID with Authlogic OpenID plugin. It supports Rails 3.0 and 2.x.

You may want to watch "OpenID with Authlogic" railscast (and the "Authlogic" railscast).

There is a sample application called Authlogic OpenID Selector Example.

restful_authentication

Another authentication library of choice is restful_authentication Rails plugin. Seems like you also need to install open_id_authentication plugin.

You may want to watch (old, circa 2007) "OpenID Authentication" railscast.

Ruby OpenID

Raw support for OpenID protocol is handled by Ruby OpenID library.

+4  A: 

Check out this Railscast on OpenId for more info. I'm not sure if/how it might work alongside restful_authentication, but might be a good resource. (I haven't watched it yet)

Jay Shepherd
Prophecy: your comment will be down-voted because anyone can suggest random search results from Google ;)
squadette
+4  A: 

What I've done is use restful-authentication and then blend the open_id_authentication plugin into your application. It might help to setup the open_id_authentication plugin on a test app as well, so you can determine the changes you'll need to make to the users table.

Calvin
A: 

Keep an eye on Bort. It is a base rails application which already has restful_authentication setup among other things. The guy doing it is planning on adding OpenID.

srboisvert
Unfortunately, Bort seems to be stale.
squadette
+4  A: 

The definitive resource should be the rails wiki, although I use should advisedly because things have been changing quite fast when it comes to OpenID support.

Ryan Bates' Railscast on Openid is the best thing I've found to follow. Even though it was recorded with Rails 1.2.3, I've been able to successfully follow the tutorial with Rails 2.1.0. The only point to note is that for:

gem install ruby-openid

I installed 2.1.2, rather than the 1.1.4 used in railscast.

The OpenID plugin used is open_id_authentication, and I tested it in combination with restful_authentication from git://github.com/technoweenie/restful-authentication.git

NB: I subsequently wrote this up in a blog post.

tardate
Unfortunately, this comment is obsolete. I've accepted my own answer and made it community wiki.
squadette
Also, Rails wiki seems to be utterly broken.
squadette
+2  A: 

dr dobbs just published this

OpenID Single Sign-On

srboisvert
This is just a random information about OpenID :( Consider deleting this answer.
squadette
+1  A: 

Bort now has OpenID included in addition to restful_authentication.

srboisvert
+1  A: 

Oddly, this subject doesn't appear to have received much attention from the Rails community since 2007.

The latest trunk of Bort didn't seem to work with Rails 2.3.x, so I forked it and got it working.

I also added some things that I personally use - like yui reset/base, jquery, etc.

The fork is very much still a work in progress, but I hope to provide broad, tested authentication support for restful auth, google auth, facebook connect, twitter, etc.

http://github.com/lukebayes/bort

Luke Bayes
Did you try to make a pull request to the upstream?Does your Bort work with 3.0?Thank you,
squadette
+1  A: 

I have found that using BinaryLogic's Authlogic gems are quite easy and straightforward to use. See Authlogic and its OpenID plugin.

You can download an example application or try it!

Marcin Gil