Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Restful Open Id Authentication

Restful Open Id Authentication

A Ruby on Rails plugin for OpenID authentication and profile exchange

Developed by EastMedia (http://www.eastmedia.com) for VeriSign Contact Matt Pelletier – matt AT eastmedia.com

Thanks to atmos for working on an extension of restful_authentication that piggy-backed the original open_id_consumer plugin. This plugin merges some of those ideas with others and merged them with the open_id_consumer plugin.

WHAT IS IT?

Installing this plugin allows you to extend your Rails application with OpenID authentication and profile exchange.

PRE-REQUISITES

  • JanRain’s Yadis and OpenID 1.1 libraries in Ruby. * These can be obtained using ‘gem install ruby-openid’
  • Requires you have an OpenID account, such as from one of the following: * http://pip.verisignlabs.com * http://www.myopenid.com
  • Rails 1.2.2 (for the singular resource routes. otherwise 1.2.1 should be fine)
  • SimplyRestful plugin from Rails * ./script/plugin install http://svn.rubonrails.org/rails/plugins/simply_restful

INSTALLATION

To install you need to run the generator script. This script will:
  • Create a migration to create tables for the user and OpenID-related tables
  • Generate two controllers (one for the model and one for the session)
  • Generate the user model
./script/generate open_id_authenticated USERMODEL CONTROLLERNAME

Where USERMODEL would be ‘User’ and CONTROLLERNAME would be ‘Session’ by default

You should add RESTful routes (this is also recommended in the generator output). For example, if your model is ‘User’ and your login controller is ‘Session’:

map.resources :users
map.resource  :session, :collection => { :begin => :post, :complete => :get }

EDUCATION

On the Web: http://www.openidenabled.com/ http://www.openidenabled.com/openid/simple-registration-extension/

On IRC: Freenode: #openid and ##identity

More to come

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly