You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Login using a username known to be in the LDAP and verify that it works
log out
try to log in with the email
Expected Behavior
To be able to login with the email
Possible Solution
I tried to create a child of LDAPBackend, and overriding the authenticate method by just printing the input, this with the intention of manipulating the login mechanism
from django_auth_ldap import backend
class LDAPEmailBackend(backend.LDAPBackend):
def authenticate(self, request, **kwargs):
print("\n\nLDAPEmailBackend authenticate")
print(request.POST)
print(request)
print(kwargs)
return super().authenticate(request, **kwargs)
and adding the volume ./ldap_email_backend.py:/home/django/cvat/ldap_email_backend.py to docker-compose.override.yml
There is a quite strange behaviour, when using username I can see the printed output from the container (docker compose logs -f cvat_server), when using an email, it doesn't even hit the authenticate method, I don't see any printed output but the api returns 400 Bad Request.
But If you first create a user using the LDAP username, and then try to login with the corresponding email of that username, I see the printed output and see that in the kwargs the field email is passed, then it fails to login. The interesting thing is if I use any other email the authenticate method is not called, as if something else is preventing it from hitting the authenticate method.
Context
No response
Environment
Tag v2.14.2
The text was updated successfully, but these errors were encountered:
Actions before raising this issue
Steps to Reproduce
Expected Behavior
To be able to login with the email
Possible Solution
I tried to create a child of LDAPBackend, and overriding the authenticate method by just printing the input, this with the intention of manipulating the login mechanism
then setting the line bellow in
settings.py
and adding the volume
./ldap_email_backend.py:/home/django/cvat/ldap_email_backend.py
todocker-compose.override.yml
There is a quite strange behaviour, when using username I can see the printed output from the container (docker compose logs -f cvat_server), when using an email, it doesn't even hit the authenticate method, I don't see any printed output but the api returns 400 Bad Request.
But If you first create a user using the LDAP username, and then try to login with the corresponding email of that username, I see the printed output and see that in the kwargs the field
email
is passed, then it fails to login. The interesting thing is if I use any other email the authenticate method is not called, as if something else is preventing it from hitting the authenticate method.Context
No response
Environment
Tag v2.14.2
The text was updated successfully, but these errors were encountered: