[python-ldap] GSSAPI and Active Directory

陈伟洪 whchen1080 at gmail.com
Mon Aug 10 11:26:04 CEST 2015


I'm unable to search Active Directory with GSSAPI for some reason.


Here's a small test script I've been using.

import ldap
import ldap.sasl

adconn = ldap.initialize('ldap://192.168.1.198:389/', trace_level=1)
adconn.protocol_version = ldap.VERSION3
sasl_auth = ldap.sasl.sasl(
           {
           },
             'GSSAPI'
             )

adconn.sasl_interactive_bind_s('', sasl_auth)



It fails every time with

  C:\Users\whchen\Downloads>python test_ldap.py

*** <ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://
192.168.1.1 98:389/ - SimpleLDAPObject.set_option ((17, 3), {}) ***
<ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://192.168.1.1
98:389/ - SimpleLDAPObject.set_option ((17, 3), {}) ***
<ldap.ldapobject.SimpleLDAPObject instance at 0x02217CD8> ldap://192.168.1.1
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'}


I do not know how to configure the client authentication information,
and I know "ldap admin" software support auth mechanism is not simple
and exchange authentication information by username / password , I
would like to know python-ldap support?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20150810/49df1904/attachment.html>


More information about the python-ldap mailing list