Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

rack-openid

Provides a more HTTPish API around the ruby-openid library

Subscribe to updates I use rack-openid


Statistics on rack-openid

Number of watchers on Github 0
Number of open issues 0
Main language
Open pull requests 0+
Closed pull requests 0+
Last commit over 8 years ago
Repo Created about 5 years ago
Repo Last Updated almost 2 years ago
Size 138 KB
Organization / Authorstitchfix
Contributors9
Page Updated
Do you use rack-openid? Leave a review!
View rack-openid activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating rack-openid for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

= 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[rack.openid.response].

=== Rack Example

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

=== Sinatra Example

# Session needs to be before Rack::OpenID use Rack::Session::Cookie

require 'rack/openid' use Rack::OpenID

get '/login' do erb :login end

post '/login' do if resp = request.env[rack.openid.response] if resp.status == :success Welcome: #{resp.display_identifier} else Error: #{resp.status} end else headers 'WWW-Authenticate' => Rack::OpenID.build_header( :identifier => params[openid_identifier] ) throw :halt, [401, 'got openid?'] end end

enable :inline_templates

END

@@ login

<p>
  <input name="commit" type="submit" value="Sign in" />
</p>

rack-openid questions on Stackoverflow (View All Questions)
  • rack-openid: identifier_url changes between deploys
  • no such file to load -- rack/openid
  • Authlogic_OpenID - "uninitialized constant Rack::OpenID"
  • Problem with require rack/openid in Rails 3 [native require work properly]
rack-openid list of languages used
Other projects in