genki / rack-openid forked from josh/rack-openid
- Source
- Commits
- Network (7)
- Downloads (2)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENSE | Fri Oct 02 15:18:55 -0700 2009 | |
| |
README.rdoc | ||
| |
Rakefile | ||
| |
deps.rip | Sun Aug 23 20:24:26 -0700 2009 | |
| |
examples/ | ||
| |
lib/ | ||
| |
rack-openid.gemspec | ||
| |
test/ | ||
| |
tmp/ | Tue Sep 08 16:06:00 -0700 2009 |
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 identity="http://example.com/"'}, []]
end
}
use Rack::OpenID
run MyApp


