Open trnc-ck opened 4 years ago
I'm having similar problems, basically if the user is new there is no problem, but if it already exists in the BD ´ldap_user` won't work
Edit: I'm using a custom backend following the wiki tutorial Edit2: still not the best solution but you can "fix it" by:
from django_auth_ldap.backend import LDAPBackend, _LDAPUser
### all your code, and when you need your ldap_user add:###
if not hasattr(user_ldap, 'ldap_user'):
user_ldap.ldap_user = _LDAPUser(self, username)
Hey,
I'm able to login. The user data gets populated in the django user model. I'm using JWT authentication through django rest framework. The only thing which doesn't work is
user.ldap_user
. It just raises'User' object has no attribute 'ldap_user'
when e.g. print the user
print(request.user.ldap_user.__dict__)
Here's my config: