I\'m trying to implement LDAP authentication in a test Django project. I think I\'ve done all the configuration correctly (I\'m using the django_ldap_auth package) and I want to
Go to your Django project folder and Start the python interpreter with
python manage.py shell
and then do,
from django_auth_ldap.backend import LDAPBackend
ldapobj = LDAPBackend()
user = ldapobj.populate_user()
user.is_anonymous()
if the last function call returns false then it your LDAP auth module works as expected.
edit:
Run the Python interpreter as above and,
import ldap
server = 'ldap://'
user_dn = ''
password = ''
con = ldap.initialize(server)
con.simple_bind_s(user_dn, password)
This will return SERVER_DOWN: {'desc': "Can't contact LDAP server"} exception, if you can't connect to the LDAP sever.