sjkingo / django_auth_ldap3

A library for connecting Django's authentication system to an LDAP directory
BSD 2-Clause "Simplified" License
23 stars 13 forks source link

Authentication fails when using a custom user model #14

Closed alandmoore closed 8 years ago

alandmoore commented 8 years ago

django_auth_ldap3 fails when trying to authenticate in an app that uses a custom user model (in my case, by subclassing AbstractUser and setting AUTH_USER_MODEL to the new class).

The solution (at least in django 1.8 and higher) is to use django.contrib.auth.get_user_model() to determine the model to use, rather than directly importing User.

I will make a pull request shortly with a patch.

sjkingo commented 8 years ago

Ohh I didn't even think of that. Thanks Alan.

I think we should look at dropping support for 1.6 and 1.7 now that 1.8 is the new LTS and <1.8 is unsupported. I'll open an issue for that. (edit: #15)