|
From: <Ric...@ju...> - 2002-09-26 12:54:40
|
I have Iplanet 5.0, which is ldapv.3 compliant. Simple authentication is=20
our bind method.
I am running win2000 on my deskpoint and my ldap resides on unix.
=20
Michael Str=F6der <mi...@st...>
09/26/2002 08:39 AM
Please respond to michael
=20
To: Ric...@ju...
cc: Python Developer List <pyt...@li...=
t>
Subject: Re: Search w/ win2000
Ric...@ju... 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=20
LDAPv2.
Unfortunately there's currently no Win32 build available of python-ldap=20
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 "=5Fs" option on the version
The synchronous method search=5Fs() 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=5Fld1.py", line 3, in ?
> l.simple=5Fbind=5Fs('uid=3Dxxxxx,ou=3Dmyou,o=3Dmyorg','xxxxx')
> LOCAL=5FERROR: {'desc': 'Local error'}
More information about your setup is needed. Which server? Is simple=20
authentication enabled at the server at all?
> l.simple=5Fbind('uid=3Dxxxxx,ou=3Dmyou,o=3Dmyorg','xxxxx')
You should use the synchronous version for binding in any case.
l.simple=5Fbind=5Fs('uid=3Dxxxxx,ou=3Dmyou,o=3Dmyorg','xxxxx')
> res =3D l.search('o=3Dmyorg', ldap.SCOPE=5FBASE,
> 'uid=3Dxxxxx,ou=3Dmyou,o=3Dmyorg',
> ["ou", "l"])
>
> for entry in res:
> [..]
> This code gives me this error msg: TypeError: iteration over
> non-sequence
search() in opposite to search=5Fs() 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.
|