Module: Devise::LdapAdapter
- Defined in:
- lib/devise_ldap_authenticatable/ldap_adapter.rb
Defined Under Namespace
Classes: LdapConnect
Class Method Summary collapse
-
.get_attribute_to_compare(login) ⇒ Object
Get the value to be compared with the db field for authenticating.
- .get_dn(login) ⇒ Object
- .get_groups(login) ⇒ Object
-
.get_persistant_attributes(login) ⇒ Object
Get the values of the attributes to be synched on to the Applications db.
- .update_password(login, new_password) ⇒ Object
- .valid_credentials?(login, password_plaintext) ⇒ Boolean
Class Method Details
.get_attribute_to_compare(login) ⇒ Object
Get the value to be compared with the db field for authenticating. Application Specific Change
58 59 60 61 62 63 64 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 58 def self.get_attribute_to_compare(login) = {:login => login, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} resource = LdapConnect.new() resource.attribute_to_compare end |
.get_dn(login) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 36 def self.get_dn(login) = {:login => login, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} resource = LdapConnect.new() resource.dn end |
.get_groups(login) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 27 def self.get_groups(login) = {:login => login, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} ldap = LdapConnect.new() ldap.user_groups end |
.get_persistant_attributes(login) ⇒ Object
Get the values of the attributes to be synched on to the Applications db. Application Specific Change
47 48 49 50 51 52 53 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 47 def self.get_persistant_attributes(login) = {:login => login, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} resource = LdapConnect.new() resource.persistant_attributes end |
.update_password(login, new_password) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 17 def self.update_password(login, new_password) = {:login => login, :new_password => new_password, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} resource = LdapConnect.new() resource.change_password! if new_password.present? end |
.valid_credentials?(login, password_plaintext) ⇒ Boolean
7 8 9 10 11 12 13 14 15 |
# File 'lib/devise_ldap_authenticatable/ldap_adapter.rb', line 7 def self.valid_credentials?(login, password_plaintext) = {:login => login, :password => password_plaintext, :ldap_auth_username_builder => ::Devise.ldap_auth_username_builder, :admin => ::Devise.ldap_use_admin_to_bind} resource = LdapConnect.new() resource. end |