title: how to use ldap for authentication for app in django?
body: <p>I want to use LDAP authentication for my application. My application is taking the input from user and storing details such as firstname,lastname in database. When I write following code in my settings.py file but I didn't get any error for that and application is running normally. So how can I know that LDAP is using in app or need some modifications in app. Please help me. I used basic settings from Django documentation.</p>
  
  <pre><code>import ldap
  from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
  # Baseline configuration.
  AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com"
  AUTH_LDAP_BIND_DN = "cn=django-agent,dc=example,dc=com"
  AUTH_LDAP_BIND_PASSWORD = "marksheet"
  AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",
      ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
  AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=django,ou=groups,dc=example,dc=com",
      ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)"
  )
  AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
  AUTH_LDAP_REQUIRE_GROUP = "cn=enabled,ou=django,ou=groups,dc=example,dc=com"
  AUTH_LDAP_USER_ATTR_MAP = {
      "first_name": "firstname",
      "last_name": "lastname",
  }
  </code></pre>
  
  <p>Thanks...</p>