The administrator login should work just like a normal login. Just adding a backend is not enough, you need to configure it. The docs say a lot:
You probably need to install this:
AUTH_LDAP_USER_FLAGS_BY_GROUP = { "is_active": "cn=active,ou=groups,dc=example,dc=com", "is_staff": "cn=staff,ou=groups,dc=example,dc=com", "is_superuser": "cn=superuser,ou=groups,dc=example,dc=com" }
These flags are IIRC used by the administrator, at least is_superuser .
But the most important thing is this material in settings.py :
AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com" import ldap from django_auth_ldap.config import LDAPSearch AUTH_LDAP_BIND_DN = "" AUTH_LDAP_BIND_PASSWORD = "" AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
Try setting up all of these materials to connect to your ldap, and if you still have problems, we can try to debug it from there.
Also try to get debugging information so that you have information if requests have been sent to your ldap (perhaps you can also check the logs made by your ldap to see if it receives requests from your application).
source share