public
Description: Provides a more HTTPish API around the ruby-openid library
Homepage: http://rdoc.info/projects/josh/rack-openid/
Clone URL: git://github.com/josh/rack-openid.git
name age message
file .gitignore Loading commit data...
file MIT-LICENSE Sun Dec 14 13:52:34 -0800 2008 first commit [josh]
file README.rdoc Mon Dec 15 21:28:15 -0800 2008 Follow proposed OpenID HTTP Auth protocol http:... [josh]
file Rakefile
directory examples/
directory lib/
file rack-openid.gemspec
directory test/
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 completition, 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 identity="http://example.com/"'}, []]
    end
  }

  use Rack::OpenID
  run MyApp