Getting can't contact LDAP server, not sure to further debug.

5,866 views
Skip to first unread message

Steve

unread,
May 10, 2011, 12:58:15 PM5/10/11
to django-auth-ldap
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)
--------------

Steve

unread,
May 10, 2011, 5:01:44 PM5/10/11
to django-auth-ldap
In the /etc/ldap.conf there was also the line "ls_checkpeer no"

adding this line to my settings.py fixed my problem:

ldap.set_option( ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER )



Thanks,

Steve

Felipe Prenholato

unread,
May 10, 2011, 5:26:19 PM5/10/11
to django-a...@googlegroups.com
I having the same problem with one of 3 Active Directory servers that I query/write, but only one.

I'll add the conf and check if works :)

Felipe 'chronos' Prenholato.
Linux User nº 405489
Home page: http://chronosbox.org/blog
Twitter: http://twitter.com/chronossc



2011/5/10 Steve <stephen....@gmail.com>

Di majo

unread,
May 12, 2024, 3:37:03 PM5/12/24
to django-auth-ldap
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+44 7529 555638

Reply all
Reply to author
Forward
0 new messages