Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

This branch is 86 commits behind josh:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib/rack
test
MIT-LICENSE
README.rdoc
Rakefile

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
Something went wrong with that request. Please try again.