简体   繁体   中英

django-ldap auth and django 1.6 deprecated warning on user_profile

On using django-auth-ldap (1.2.0) with django 1.6 on my linux running python 2.7 I get the warning:

 The use of AUTH_PROFILE_MODULE to define user profiles has been deprecated. profile = self._user.get_profile() 

My settings.py contain LDAP settings:

import ldap
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType

# Keep ModelBackend around for per-user permissions and maybe a local
# superuser.
AUTHENTICATION_BACKENDS = (
    'django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend',
)

AUTH_LDAP_SERVER_URI = "ldap://127.0.0.1"
AUTH_LDAP_BIND_DN = "cn=ram Krishna,ou=users,dc=test,dc=com"
AUTH_LDAP_BIND_PASSWORD = "ram"
AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=test,dc=com",
                                   ldap.SCOPE_SUBTREE, "(uid=%(user)s)")

No other settings for LDAP in this py file

My slapd entry with ldapsearch -x shows:

# ram Krishna, users, test.com
dn: cn=ram Krishna,ou=users,dc=test,dc=com
cn: ram Krishna
mail: ram@y.com
givenName: ram
sn: Krishna
objectClass: inetOrgPerson
objectClass: top
uid: ram

Why am I not able to authenticate?

I get the same warning but my ldap works fine.

I only see 2 difference between your LDAP settings and mine

1. AUTH_LDAP_BIND_DN = "???@test.com"
2. AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=test,dc=com", ldap.SCOPE_SUBTREE, u"(sAMAccountName=%(user)s)")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM