I'm new to LDAP authentication and going through some of the StackOverflow questions and django-auth-ldap documentation I was able to implement LDAP authentication in my django project. I have a custom user model to store the user information. But my question here is that when we do authenticate using user_id and password why does authenticate store the user info in the custom user model. It also stores the hashed password.
I have used LDAPBackend as my authentication backend in settings.py file like this
AUTHENTICATION_BACKENDS = [
'django_auth_ldap.backend.LDAPBackend'
]
and for example when we perform the below operation
auth = LDAPBackend()
user = auth.authenticate(request, username=user_id, password=user_password)
the user object is stored in the custom user model. My requirement is here not to store any user information when authenticate happens and not to store any password(be it hashed password). There are some pre-checks I need to do before storing it into user info to the custom user model. But LDAPBackend.authenticate() stores user info as it authenticates.
Can anyone please help me on this and clarify what's going on here.
Thanks