Class | Rack::OpenID |
In: |
lib/rack/openid.rb
lib/rack/openid/simple_auth.rb |
Parent: | Object |
A Rack middleware that provides a more HTTPish API around the ruby-openid library.
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.
Helper method for building the "WWW-Authenticate" header value.
Rack::OpenID.build_header(:identifier => "http://josh.openid.com/") #=> OpenID identifier="http://josh.openid.com/"
Initialize middleware with application and optional OpenID::Store. If no store is given, OpenID::Store::Memory is used.
use Rack::OpenID
or
use Rack::OpenID, OpenID::Store::Memcache.new
Helper method for parsing "WWW-Authenticate" header values into a hash.
Rack::OpenID.parse_header("OpenID identifier='http://josh.openid.com/'") #=> {:identifier => "http://josh.openid.com/"}