We use django-allauth for authentication. And we want to use django-auth-ldap.
Currently, we can login with LDAP from the default django sign-in page (/admin).
We learned that this should be done with the DefaultAccountAdapter in the django-allauth package.
How can we login with LDAP information using django-allauth sign-in page?
# project/settings.py:
ACCOUNT_ADAPTER = ‘project.users.adapter.CustomAccountAdapter’
# project/users/adapter.py:
from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter
class CustomAccountAdapter(DefaultAccountAdapter):
…