python-ldap with MDS()
Lawrence Berkeley National Laboratory
Distributed Computing Department
National Energy Research Scientific Computing Center
Computing Sciences Division

Documentation Links
Instructions
  • Goto to python-ldap and follow the directions to get the code from anonymous cvs.
  • Add the following class to the bottom of Lib/ldap/sasl.py: class gsigssapi(sasl): """This class handles SASL GSI-GSSAPI authentication.""" def __init__(self, authorization=""): sasl.__init__(self, {sasl.CB_USER:authorization}, "GSI-GSSAPI")
  • Edit setup.cfg so that the "libs" line looks like: libs = ldap_gcc32dbgpthr lber_gcc32dbgpthr This allows us to link against the globus flavored libs.
  • Also edit the paths to find the libs and include files.
Example setup.cfg
# Section for compiling the C extension module
# for wrapping OpenLDAP 2 libs

[_ldap]
class = OpenLDAP2
library_dirs = /usr/local/gt2/lib
include_dirs = /usr/local/gt2/include/gcc32dbgpthr
# Standard build
# for the SASL library
libs = ldap_gcc32dbgpthr lber_gcc32dbgpthr
# Some Linux systems might need explicitly linking with -lresolv
#libs = ldap lber resolv
# For building with cygwin
#libs = ldap lber ssl crypto

# Installation options

[install]
compile = 1
optimize = 1
build, install, test
  • Now follow the python-ldap directions to build. "python setup.py build", "python setup.py install".
  • Change the ldap URL, and base DN as appropriate for your environment.
  • To test your installation, make sure you have a valid GSI proxy, and then run: import ldap, ldap.sasl l = ldap.initialize("ldap://scott.lbl.gov:2135") auth = ldap.sasl.gsigssapi() l.sasl_bind_s("", auth) res = l.search_s("Mds-Vo-name=DSD, o=Grid",ldap.SCOPE_SUBTREE, "(objectClass=*)") print res l.unbind()


LBNL Home Page. DSD Home Page. Grid Technologies. DOE Science Grid.

You are visitor [an error occurred while processing this directive] to this page since January 2001.

This document was last updated on October 17, 2002, and is located at http://www-itg.lbl.gov/gtg/projects/misc/mds_python-ldap.html.
To report Web page problems, e-mail webmaster@www-itg.lbl.gov. To request further information about ITG activities, e-mail wejohnston@lbl.gov.
Support Credits identify the funding sources and the organizational context of the work described in this document.
Privacy and site security notice to Users

Joshua Boverhof (JRBoverhof@lbl.gov) is responsible for this WWW document.