SASL (part 3)
Hans Aschauer
Hans.Aschauer at Physik.uni-muenchen.de
Fri Mar 15 16:28:53 CET 2002
Its me again :-)
I have something usable now, as I think. The interface looks like this:
-------------------------8<----------------------------
import ldap
# from sasl import sasl_digest_md5 # XXX
l = ldap.initialize("ldap://localhost/")
auth = sasl_digest_md5("aschauer","secret")
l.sasl_bind_s("", auth)
res = l.search_s("dc=myorg,dc=com", ldap.SCOPE_ONELEVEL,
"objectclass=*")
print res
l.unbind()
-------------------------8<-------------------------
Comments?
The interesting part is the sasl_digest_md5 class, that handles the
SASL callbacks (source attached, also for sasl_gssapi and, as a base
class, a generic sasl class).
The diff is against cvs (made with "cvs diff").
If anybody wants to test it and needs assistance with setting things
up, feel free to contact me.
Hans
--
Hans.Aschauer at Physik.uni-muenchen.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sasl.patch
Type: text/x-diff
Size: 6930 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20020315/05d4a21c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sasl_bind.py
Type: text/x-python
Size: 2400 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20020315/05d4a21c/attachment.py>
More information about the python-ldap
mailing list