Search w/ win2000

Richard.Ferry at judiciary.state.nj.us Richard.Ferry at judiciary.state.nj.us
Thu Sep 26 14:52:47 CEST 2002


I have Iplanet 5.0, which is ldapv.3 compliant. Simple authentication is 
our bind method.

I am running win2000 on my deskpoint and my ldap resides on unix.


 




Michael Ströder <michael at stroeder.com>
09/26/2002 08:39 AM
Please respond to michael

 
        To:     Richard.Ferry at judiciary.state.nj.us
        cc:     Python Developer List <python-ldap-dev at lists.sourceforge.net>
        Subject:        Re: Search w/ win2000


Richard.Ferry at judiciary.state.nj.us wrote:
 >
 > I have version ldap-1.10a3 installed. I am running on a python 2.2 on
 > a win2000 system.

Which LDAP server? Active Directory? Note that python-ldap 1.x cannot
open an LDAPv3 connection. It's limited to LDAPv2 which is not allowed
with Active Directory I suspect. There are other caveats of 1.x and 
LDAPv2.

Unfortunately there's currently no Win32 build available of python-ldap 
2.x which is based on OpenLDAP 2.x libs.

 > I have been unable to make the search work. Below are some of my
 > unsuccessful tries. Can I use the "_s" option on the version

The synchronous method search_s() is what you probably like to use. It
returns the search result als list of 2-tuples containing the
distinguished name (string) and the entry (dictionary).

 > Traceback (most recent call last):
 >   File "C:\Python22\test_ld1.py", line 3, in ?
 >     l.simple_bind_s('uid=xxxxx,ou=myou,o=myorg','xxxxx')
 > LOCAL_ERROR: {'desc': 'Local error'}

More information about your setup is needed. Which server? Is simple 
authentication enabled at the server at all?

 > l.simple_bind('uid=xxxxx,ou=myou,o=myorg','xxxxx')

You should use the synchronous version for binding in any case.

l.simple_bind_s('uid=xxxxx,ou=myou,o=myorg','xxxxx')

 > res = l.search('o=myorg', ldap.SCOPE_BASE,
 > 'uid=xxxxx,ou=myou,o=myorg',
 > ["ou", "l"])
 >
 > for entry in res:
  > [..]
 > This code gives me this error msg: TypeError: iteration over
 > non-sequence

search() in opposite to search_s() returns an integer representing the
message ID of the started LDAP operation which is then used when calling
result(). That's probably not what you want.

Ciao, Michael.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20020926/630f72eb/attachment.html>


More information about the python-ldap mailing list