im trying to get it working, i configured my settings.py like this:
import ldap from django_auth_ldap.config import LDAPSearch, GroupOfNamesType # Baseline configuration. AUTH_LDAP_SERVER_URI = "ldap://myldapurl:myportnumber" AUTH_LDAP_BIND_DN = "" AUTH_LDAP_BIND_PASSWORD = "" AUTH_LDAP_USER_SEARCH = LDAPSearch("dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)") # Set up the basic group parameters. AUTH_LDAP_GROUP_SEARCH = LDAPSearch("dc=example,dc=com", ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)" ) AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn") # Populate the Django user from the LDAP directory. AUTH_LDAP_USER_ATTR_MAP = { "username": "sn", "first_name": "cn", "last_name": "sn", "email": "mail" } AUTH_LDAP_USER_FLAGS_BY_GROUP = { "is_active": "dc=example,dc=com", "is_staff": "dc=example,dc=com", "is_superuser": "dc=example,dc=com" } # Keep ModelBackend around for per-user permissions and maybe a local # superuser. AUTHENTICATION_BACKENDS = ( 'django_auth_ldap.backend.LDAPBackend', 'django.contrib.auth.backends.ModelBackend', ) django starts, i get no error messages, no success messages, no users in the db, really no signal at all. how can i check if i am connected or not? what is the username if i dont set it explicitly in the AUTH_LDAP_USER_ATTR_MAP? David De La Harpe Golden wrote: > On 03/02/10 13:41, andreas schmid wrote: >> hi, >> >> i need to authenticate users through ldap but i need also to store their >> preferences in the database, i cant really understand if >> django-auth-ldap (http://packages.python.org/django-auth-ldap) only >> authenticats the users over ldap or if it creates a real user object in >> django. > > AFAICS it creates a corresponding User object if one is missing for > each ldap authenticated user at authentication time (good ol' > get_or_create). Pretty much all django apps with any per-user > functionality expect you to be using django.contrib.auth.models.User > for users, so doing so makes a lot of sense. > > http://bitbucket.org/kozo_ni/django-auth-ldap/src/tip/django_auth_ldap/backend.py#cl-209 > > > http://bitbucket.org/kozo_ni/django-auth-ldap/src/tip/django_auth_ldap/backend.py#cl-346 > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.