Simplified OpenID Authentication Plugin for Ruby on Rails
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Provides a simple authentication system for web applications that don't need a full user registration system and choose
instead to rely completely on OpenID for their needs. Will store user models and associate them with identity URLs,
allowing you to build local profiles associated with a users's OpenID. DOES NOT support non-OpenID account creation. We
suggest either running your own provider (there are plenty of OSS provider packages) or refering users to an existing 
OpenID provider instead (TIP: use the ID Selector available at Many larger providers offer affiliate
programs that allow you to brand their signup processes and redirect users back to your website when finished.

This work is based on Rick Olson's Restful Authentication plugin and the original OpenID Authentication plugin for 
Rails. However, many of the extra features of the former plugin have been removed for streamlined simplicity. If you 
want a highly customizable authentication system that supports traditional local accounts as well as OpenID and has all
the bells and whistles, install those two plugins and write a bit of code to integrate them. On the other hand, if you
just need a barebones OpenID-based authentication system and a user model, this plugin should do the trick right out of
the box.


You need Rails 2.1. You also need Mocha and JanRain's excellent ruby-openid gem:

  gem install ruby-openid mocha

To understand what OpenID is about and how it works, check the documentation for lib/openid/consumer.rb.

The specification used is


Get the latest sources from GitHub!

ruby script/plugin install git://

Then run the supplied generator:

ruby script/generate authenticated

This will create two models for you, a User model and an IdentityUrl model (a User may have any number of IdentityURLs
associated with it). It will also create a SessionsController and the new session view for that controller, as well as
the required routes.

The SessionsController allows you to specify any optional fields you wish to populate in the User model from Simple
Registration (sreg) data. We recommend that you create a UsersController and have the SessionsController redirect to 
its #edit action after successfully creating an account. That way, you can allow your users to specify additional 
profile data if it was not obtained via sreg.

Note that, with OpenID, both the signup and login portions are treated the same; they're both handled via the
SessionsController's #create action. You may wish to add a redirect for the #new action on UsersController to
SessionsController. We recommend integrating the ID Selector available at into your login form
for increased usability. You just need to add one (generated) piece of JavaScript to the new.html.erb template to make 
it work.

These are merely a few suggestions; the generated sources should work fine with or without these modifications! The
only other thing you will absolutely have to do is add a mapping for the application root to your routes with a
map.root directive.


Portions belonging to the original Rails OpenId Authentication plugin (c) 2008 David Heinemeier Hansson.
Portions belonging to the Restful Authentication plugin original (c) 2008 Rick Olson.

* Randy Schmidt (r38y)
* Marko Anastasov (markoa)

All other work (c) 2008 Nick Plante. This plugin is released under the MIT license.