ldap.sasl.gssapi example?

Gavin Doughtie gdoughtie at anim.dreamworks.com
Tue Apr 6 22:48:34 CEST 2004

I'm having fits with ldap.sasl, and was wondering if perhaps I was just 
suffering from a conceptual gap. Maybe there's some sample code 
someplace that I couldn't find with google?

I need to use Kerberos authentication through GSSAPI to talk to our LDAP 
server.  I have a valid Kerberos ticket granting ticket, and I can use 
the ldapadd utility to accomplish what I want on the server in question, 
so I know that my account is properly provisioned.

Code looks like this:

     l = ldap.open('ldapserver.dreamworks.com')
     auth = ldap.sasl.gssapi()
     l.sasl_interactive_bind_s('', auth)

traceback like this:

     l.sasl_interactive_bind_s('', auth)
   File "/usr/local/lib/python2.3/site-packages/ldap/ldapobject.py", 
line 196, in sasl_interactive_bind_s
   File "/usr/local/lib/python2.3/site-packages/ldap/ldapobject.py", 
line 94, in _ldap_call
     result = func(*args,**kwargs)
ldap.LOCAL_ERROR: {'desc': 'Local error'}

Gavin Doughtie
DreamWorks SKG

More information about the python-ldap mailing list