Module: Devise::Models::LdapAuthenticatable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise_ldap_authenticatable/model.rb
Overview
LDAP Module, responsible for validating the user credentials via LDAP.
Examples:
User.authenticate('[email protected]', 'password123') # returns authenticated user or nil
User.find(1).valid_password?('password123') # returns true/false
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #in_ldap_group?(group_name, group_attribute = LdapAdapter::DEFAULT_GROUP_UNIQUE_MEMBER_LIST_KEY) ⇒ Boolean
- #ldap_dn ⇒ Object
- #ldap_get_param(login_with, param) ⇒ Object
- #ldap_groups ⇒ Object
- #login_with ⇒ Object
Instance Method Details
#in_ldap_group?(group_name, group_attribute = LdapAdapter::DEFAULT_GROUP_UNIQUE_MEMBER_LIST_KEY) ⇒ Boolean
24 25 26 |
# File 'lib/devise_ldap_authenticatable/model.rb', line 24 def in_ldap_group?(group_name, group_attribute = LdapAdapter::DEFAULT_GROUP_UNIQUE_MEMBER_LIST_KEY) Devise::LdapAdapter.in_ldap_group?(login_with, group_name, group_attribute) end |
#ldap_dn ⇒ Object
28 29 30 |
# File 'lib/devise_ldap_authenticatable/model.rb', line 28 def ldap_dn Devise::LdapAdapter.get_dn(login_with) end |
#ldap_get_param(login_with, param) ⇒ Object
32 33 34 |
# File 'lib/devise_ldap_authenticatable/model.rb', line 32 def ldap_get_param(login_with, param) Devise::LdapAdapter.get_ldap_param(login_with,param) end |
#ldap_groups ⇒ Object
20 21 22 |
# File 'lib/devise_ldap_authenticatable/model.rb', line 20 def ldap_groups Devise::LdapAdapter.get_groups(login_with) end |
#login_with ⇒ Object
15 16 17 18 |
# File 'lib/devise_ldap_authenticatable/model.rb', line 15 def login_with @login_with ||= Devise.mappings[self.class.to_s.underscore.to_sym].to.authentication_keys.first self[@login_with] end |