Hi all,
I'm brand new to django_auth_ldap and am uncertain how I can proceed.
Any hints would be appreciated.
The linux box I am on uses LDAP to authenticate users (that seems to
work fine) and I have copied pertinent lines from the /etc/ldap.conf
file
to my settings.py file.
When I try to authenticate using the django dev server (ie python
manage.py runserver
0.0.0.0:8000) I get the following log warning
(replaced my username with _my_username_):
Caught LDAPError while authenticating _my_username_:
SERVER_DOWN({'info': '(unknown error code)', 'desc': "Can't contact
LDAP server"},)
Caught LDAPError while authenticating _my_username_:
SERVER_DOWN({'info': '(unknown error code)', 'desc': "Can't contact
LDAP server"},)
I'm certain that the AUTH_LDAP_SERVER_URI, AUTH_LDAP_BIND_DN, and
AUTH_LDAP_BIND_PASSWORD fields are correct. Of the LDAPSearch()
fields, I'm fairly certain that the base_dn is correct and no idea if
the scope or filterstr are correct.
Could a poorly configured LDAPSearch cause the log warning I'm seeing?
python 2.6.5
django_auth_ldap-1.0.9-py2.6.egg
django 1.3
-------- from settings.py ---------
#sanitized to remove sensitive information.
AUTH_LDAP_SERVER_URI = 'ldaps://
192.168.1.1''
AUTH_LDAP_BIND_DN = 'cn=more_goes_here,cn=Users,dc=somecompany,dc=com'
AUTH_LDAP_BIND_PASSWORD = 'password_goes_here'
AUTH_LDAP_AUTHORIZE_ALL_USERS = True
AUTH_LDAP_USER_SEARCH = LDAPSearch("dc=somecompany,dc=com",
ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.WARN)
--------------