Class: WizAuthc::Authenticator

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/wizdog/authc/authenticator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAuthenticator

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

#storageObject

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

Returns:

  • (Boolean)


26
27
28
# File 'lib/wizdog/authc/authenticator.rb', line 26

def authenticated?

end