I want to import the users of a ActiveDirectory database into Django. To this end I'm trying to use the django_auth_ldap module.
Here is what I tried already :
in my settings.py :
AUTH_LDAP_SERVER_URI = "ldap://example.fr"
AUTH_LDAP_BIND_DN = 'cn=a_user,dc=example,dc=fr'
AUTH_LDAP_BIND_PASSWORD=''
AUTH_LDAP_USER_SEARCH = LDAPSearch('ou=users,dc=example,dc=fr', ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
AUTH_LDAP_GROUP_SEARCH = LDAPSearch('ou=groups,dc=example,dc=fr', ldap.SCOPE_SUBTREE, '(objectClass=groupOfNames)')
AUTH_LDAP_GROUP_TYPE = ActiveDirectoryGroupType()
#Populate the Django user from the LDAP directory
AUTH_LDAP_USER_ATTR_MAP = {
'first_name': 'sAMAccountName',
'last_name': 'displayName',
'email': 'mail'
}
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
Then I call python manage.py syncdb
with no result. No warning, no error, nothing updataed in the auth_user table. Is there something obvious I forgot to do ?