Class: Rack::Auth::OpenIDAuth
- Inherits:
-
AbstractHandler
- Object
- AbstractHandler
- Rack::Auth::OpenIDAuth
- Defined in:
- lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb
Overview
A class developed out of the request to use OpenID as an authentication middleware. The request will be sent to the OpenID instance unless the block evaluates to true. For example in rackup, you can use it as such:
use Rack::Session::Pool
use Rack::Auth::OpenIDAuth, realm, do |env|
env['rack.session'][:authkey] == a_string
end
run RackApp
Or simply:
app = Rack::Auth::OpenIDAuth.new app, realm, , &auth
Instance Attribute Summary collapse
-
#oid ⇒ Object
readonly
Returns the value of attribute oid.
Attributes inherited from AbstractHandler
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, realm, options = {}, &auth) ⇒ OpenIDAuth
constructor
A new instance of OpenIDAuth.
Constructor Details
#initialize(app, realm, options = {}, &auth) ⇒ OpenIDAuth
Returns a new instance of OpenIDAuth.
469 470 471 472 |
# File 'lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb', line 469 def initialize(app, realm, ={}, &auth) @oid = OpenID.new(realm, ) super(app, &auth) end |
Instance Attribute Details
#oid ⇒ Object (readonly)
Returns the value of attribute oid.
468 469 470 |
# File 'lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb', line 468 def oid @oid end |
Instance Method Details
#call(env) ⇒ Object
474 475 476 477 |
# File 'lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb', line 474 def call(env) to = auth.call(env) ? @app : @oid to.call env end |