Connection to AD on windows

Jeroen Michiel jmichiel at
Wed Aug 5 17:23:28 CEST 2009


I'm trying to get python-ldap working on a windows machine to authenticate users against an Active Directory server.
However, I'm getting the weirdest things...

This is what I'm trying:

import ldap, ldap.sasl

conn = ldap.initialize('ldap://blabla')
conn.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)
sasl = ldap.sasl.gssapi()
conn.sasl_interactive_bind_s('', sasl)

upon the sasl_interactive_bind_s, I get the following traceback:

Traceback (most recent call last):
  File "D:\Projects\Python\ldap\src\", line 12, in <module>
    conn.sasl_interactive_bind_s('', sasl)
  File "c:\python25\lib\site-packages\python_ldap-2.3.9-py2.5-win32.egg\ldap\", line 219, in sasl_interactive_bind_s
    return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls),sasl_flags)
  File "c:\python25\lib\site-packages\python_ldap-2.3.9-py2.5-win32.egg\ldap\", line 96, in _ldap_call
    result = func(*args,**kwargs)
ldap.SUCCESS: {'desc': 'Success'}

so apparently an exception of type ldap.SUCCESS seems to be thrown, which doesn't make much sense...

What's going on?
I'm totally clueless...

Im using the 2.3.9 release I got here:

Thanks in advance for any ideas!


More information about the python-ldap mailing list