Install the package with pip:
$ pip install django-auth-ldap
AUTHENTICATION_BACKENDS = ["django_auth_ldap.backend.LDAPBackend"]
LDAPBackend should work with custom user
models, but it does assume that a database is present.
LDAPBackend does not inherit from
ModelBackend. It is possible to use
LDAPBackend exclusively by configuring
it to draw group membership from the LDAP server. However, if you would
like to assign permissions to individual users or add users to groups
within Django, you’ll need to have both backends installed:
AUTHENTICATION_BACKENDS = [ "django_auth_ldap.backend.LDAPBackend", "django.contrib.auth.backends.ModelBackend", ]
Django will check each authentication backend in order, so you are free to
reorder these if checking
ModelBackend first is more
applicable to your application.