<div dir="ltr"><pre><font color="#000000">I'm unable to search Active Directory with GSSAPI for some reason.


Here's a small test script I've been using.</font><pre><font color="#000000">import ldap
import ldap.sasl

adconn = ldap.initialize('ldap://<a href="http://192.168.1.198:389/" target="_blank">192.168.1.198:389/</a>', trace_level=1)
adconn.protocol_version = ldap.VERSION3
sasl_auth = ldap.sasl.sasl(
           {
           },
             'GSSAPI'
             )

adconn.sasl_interactive_bind_s('', sasl_auth)</font></pre><pre><font color="#000000">

It fails every time with

  C:\Users\whchen\Downloads>python test_ldap.py</font></pre><font color="#000000">*** <ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://<a href="http://192.168.1.1" target="_blank">192.168.1.1</a>
98:389/ - SimpleLDAPObject.set_option
((17, 3), {})
*** <ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://<a href="http://192.168.1.1" target="_blank">192.168.1.1</a>
98:389/ - SimpleLDAPObject.set_option
((17, 3), {})
*** <ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://<a href="http://192.168.1.1" target="_blank">192.168.1.1</a>
98:389/ - SimpleLDAPObject.sasl_interactive_bind_s
(('', <ldap.sasl.sasl instance at 0x0226E1E8>, None, None, 2), {})
Traceback (most recent call last):
  File "test_ldap.py", line 16, in <module>
    adconn.sasl_interactive_bind_s('', sasl_auth)
  File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 244, in sasl_int
eractive_bind_s
    return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,RequestContr
olTuples(serverctrls),RequestControlTuples(clientctrls),sasl_flags)
  File "C:\Python27\lib\site-packages\ldap\ldapobject.py", line 106, in _ldap_ca
ll
    result = func(*args,**kwargs)
ldap.LOCAL_ERROR: {'info': 'SASL(-1): generic failure: Unable to find a callback
: 2', 'desc': 'Local error'}</font></pre><pre><font color="#000000"><br></font></pre><pre>I do not know how to configure the client authentication information, and I know "ldap admin" software support auth mechanism is not simple and <span style="font-family:arial,sans-serif">exchange </span><span style="font-family:arial,sans-serif">authentication information by </span><span style="font-family:arial,sans-serif">username / password , I would like to know python-ldap support?</span></pre></div>