views:

845

answers:

5

What's the best (easy) way to implement a login/authentication system on a Rails web-app that looks and works like the Stackoverflow system?

I realize that it's basicly OpenID, but Stackoverflow handles integration with multiple providers.

Is there a easy way to this on Rails? Or do we have to hack restfull_auth or authlogic to do that?

+3  A: 

Ryan has a decent railscast about this.

Jason Punyon
+3  A: 

http://rubyforge.org/projects/ruby-openid/

This may provide you with a solution. Also look at http://leancode.com/openid-for-rails/ for some resources and recommendations for OpenID on rails.

This also looks promising, although I haven't seen the documentation. You might want to check it out.

mandaleeka
+2  A: 

Stackoverflow doesn't really do anything special for specific providers. It just takes an OpenId and then transfers the browser to the url processes it.

You might want to check out this blog entry on integrating OpenId into your rails application:

http://www.danwebb.net/2007/2/27/the-no-shit-guide-to-supporting-openid-in-your-applications

casperOne
+5  A: 

I believe StackOverflow uses the OpenID Selector, which for the visual effect is all HTML and Javascript, so you should be able to easily apply it to your Rails app that already uses a Ruby OpenID library.

Andrew Arnott
Does the Ruby OpenID library support account providers like Google and Yahoo (as does OpenID Selector)?
Javier
As far as I tested it, it works with all the major openID providers, including google and yahoo!
rubenfonseca
+2  A: 

Hi, I've just implemented what you're looking for in an example application:

http://openid-example.joontos.ch

(check out the link to the source code)

Javier
excellent example! thank you!
rubenfonseca
@Javier its gone :-(
piemesons