Class: CASinoCore::Authenticator::LDAP
- Inherits:
-
Object
- Object
- CASinoCore::Authenticator::LDAP
- Defined in:
- lib/casino_core/authenticator/ldap/version.rb,
lib/casino_core/authenticator/ldap.rb
Constant Summary collapse
- VERSION =
'0.0.4'
- DEFAULT_USERNAME_ATTRIBUTE =
'uid'
Instance Method Summary collapse
-
#initialize(options) ⇒ LDAP
constructor
A new instance of LDAP.
- #validate(username, password) ⇒ Object
Constructor Details
#initialize(options) ⇒ LDAP
Returns a new instance of LDAP.
8 9 10 |
# File 'lib/casino_core/authenticator/ldap.rb', line 8 def initialize() @options = end |
Instance Method Details
#validate(username, password) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/casino_core/authenticator/ldap.rb', line 12 def validate(username, password) @username = username @password = password begin connect authenticate if !@user_plain false else generate_user @user end rescue Net::LDAP::LdapError => e raise CASinoCore::Authenticator::AuthenticatorError, "LDAP authentication failed with '#{e}'. Check your authenticator configuration." end end |