Class: CASino::LDAPAuthenticator
- Inherits:
-
Object
- Object
- CASino::LDAPAuthenticator
- Defined in:
- lib/casino/ldap_authenticator/version.rb,
lib/casino/ldap_authenticator.rb
Constant Summary collapse
- VERSION =
'2.0.3'- DEFAULT_USERNAME_ATTRIBUTE =
'uid'
Instance Method Summary collapse
-
#initialize(options) ⇒ LDAPAuthenticator
constructor
A new instance of LDAPAuthenticator.
- #validate(username, password) ⇒ Object
Constructor Details
#initialize(options) ⇒ LDAPAuthenticator
Returns a new instance of LDAPAuthenticator.
8 9 10 |
# File 'lib/casino/ldap_authenticator.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 |
# File 'lib/casino/ldap_authenticator.rb', line 12 def validate(username, password) begin user_plain = authenticate(username, password) if !user_plain false else generate_user(user_plain) end rescue Net::LDAP::LdapError => e raise CASino::Authenticator::AuthenticatorError, "LDAP authentication failed with '#{e}'. Check your authenticator configuration." end end |