public
Description: Provides a more HTTPish API around the ruby-openid library
Homepage: http://rubyforge.org/projects/rack-openid/
Clone URL: git://github.com/josh/rack-openid.git
name age message
file .gitignore Tue Sep 08 16:06:00 -0700 2009 more robust test process cleanup [josh]
file LICENSE Fri Oct 02 15:18:55 -0700 2009 rename to just LICENSE [josh]
file README.rdoc Mon Nov 16 11:54:30 -0800 2009 prefer identifier over identity [josh]
file Rakefile Fri Oct 02 15:20:12 -0700 2009 switch to mg publishing tasks [josh]
file deps.rip Sun Aug 23 20:24:26 -0700 2009 rip deps [josh]
directory examples/ Mon Aug 17 08:28:13 -0700 2009 never require rubygems [josh]
directory lib/ Mon Nov 16 12:01:11 -0800 2009 support deprecated identity key [josh]
file rack-openid.gemspec Fri Oct 02 15:18:55 -0700 2009 rename to just LICENSE [josh]
directory test/ Mon Nov 16 12:01:11 -0800 2009 support deprecated identity key [josh]
directory tmp/ Tue Sep 08 16:06:00 -0700 2009 more robust test process cleanup [josh]
README.rdoc

Rack::OpenID

Provides a more HTTPish API around the ruby-openid library.

Usage

You trigger an OpenID request similar to HTTP authentication. From your app, return a "401 Unauthorized" and a "WWW-Authenticate" header with the identifier you would like to validate.

On competition, the OpenID response is automatically verified and assigned to env.

  MyApp = lambda { |env|
    if resp = env["rack.openid.response"]
      case resp.status
      when :success
        ...
      when :failure
        ...
    else
      [401, {"WWW-Authenticate" => 'OpenID identifier="http://example.com/"'}, []]
    end
  }

  use Rack::OpenID
  run MyApp