Class: TorqueBox::Authenticator
- Inherits:
-
Object
- Object
- TorqueBox::Authenticator
- Defined in:
- lib/torquebox/security/authentication.rb
Instance Method Summary collapse
- #authenticate(user, pass, &block) ⇒ Object
-
#initialize(auth_bean) ⇒ Authenticator
constructor
A new instance of Authenticator.
Constructor Details
#initialize(auth_bean) ⇒ Authenticator
Returns a new instance of Authenticator.
44 45 46 |
# File 'lib/torquebox/security/authentication.rb', line 44 def initialize(auth_bean) @auth_bean = auth_bean end |
Instance Method Details
#authenticate(user, pass, &block) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/torquebox/security/authentication.rb', line 48 def authenticate(user, pass, &block) if @auth_bean.nil? $stderr.puts "ERROR: No authentication delegate found. Authentication not enabled." return false end authenticated = @auth_bean.authenticate(user, pass) block.call if authenticated && block authenticated end |