I'm working on a django project and I'm trying to authenticate my APP against LDAP server. settings.py:
AUTH_LDAP_SERVER_URI = "ldap://domain.local"
AUTH_LDAP_BIND_DN = "domain\django"
AUTH_LDAP_BIND_PASSWORD = "<Password>"
AUTH_LDAP_USER_SEARCH = LDAPSearch("cn=Users,dc=domain,dc=local",
ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
Code:
from django_auth_ldap.backend import LDAPBackend
auth = LDAPBackend()
auth.authenticate(username="omers", password="<password>")
For now I'm just using the shell
When I do tcpdump I see the LDAP packet but for some reason the LDAP server can't find my user but I know it's exist, what am I missing?
Thanks!
"domain\django". Should ber"domain\django"(in that case it works, though). And can you post the error message? - Jean-François Fabre