Class: WizAuthc::Authenticator
- Inherits:
-
Object
- Object
- WizAuthc::Authenticator
- Includes:
- Singleton
- Defined in:
- lib/wizdog/authc/authenticator.rb
Instance Attribute Summary collapse
-
#storage ⇒ Object
Returns the value of attribute storage.
Instance Method Summary collapse
-
#authenticate(realm) ⇒ Object
return authentication.
- #authenticated? ⇒ Boolean
-
#initialize ⇒ Authenticator
constructor
A new instance of Authenticator.
Constructor Details
#initialize ⇒ Authenticator
Returns a new instance of Authenticator.
10 11 12 |
# File 'lib/wizdog/authc/authenticator.rb', line 10 def initialize @storage = Thread.current[:identity] end |
Instance Attribute Details
#storage ⇒ Object
Returns the value of attribute storage.
8 9 10 |
# File 'lib/wizdog/authc/authenticator.rb', line 8 def storage @storage end |
Instance Method Details
#authenticate(realm) ⇒ Object
return authentication
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/wizdog/authc/authenticator.rb', line 15 def authenticate(realm) authentication = realm.authenticate() if authenticated? storage = nil end if authentication.authenticated? storage = authentication.identity end return authentication end |
#authenticated? ⇒ Boolean
26 27 28 |
# File 'lib/wizdog/authc/authenticator.rb', line 26 def authenticated? end |