Class: Rack::OpenID::SimpleAuth
- Inherits:
-
Object
- Object
- Rack::OpenID::SimpleAuth
- Defined in:
- lib/rack/openid/simple_auth.rb
Overview
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, identifier) ⇒ SimpleAuth
constructor
A new instance of SimpleAuth.
Constructor Details
#initialize(app, identifier) ⇒ SimpleAuth
Returns a new instance of SimpleAuth.
20 21 22 23 |
# File 'lib/rack/openid/simple_auth.rb', line 20 def initialize(app, identifier) @app = app @identifier = identifier end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
18 19 20 |
# File 'lib/rack/openid/simple_auth.rb', line 18 def app @app end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
18 19 20 |
# File 'lib/rack/openid/simple_auth.rb', line 18 def identifier @identifier end |
Class Method Details
Instance Method Details
#call(env) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rack/openid/simple_auth.rb', line 25 def call(env) if session_authenticated?(env) app.call(env) elsif successful_response?(env) authenticate_session(env) redirect_to requested_url(env) else authentication_request end end |