Getting LDAP Bind status

Joined
Oct 25, 2006
Messages
2
Reaction score
0
Ok, first time I've needed to test a bind, whats wrong with it?

l = ldap.initialize("ldaps://server:636",trace_level=2)
l.protocol_version = 3

do a bind a know user, then bounce out the dn for the proper bind. Thats all good, can thet attributes out and play with happily, I then need to test the users credentials against ldap in order to then run an LDAP modify on some attributes, I'm using:

try:
l.simple_bind(dn,oldpass)
valid=True
except ldap.LDAPError, e:
valid=False
if valid:
print "****************valid****************"
else:
print "--------------- nope ----------------"


with the latter being my debug code obviously ;-)

It always returns valid, even though with the wrong credentials I can see the rejection on the LDAP server.

Surely this must be straight forward and I'm missing something??

Cheers

Jim
 
Joined
Oct 25, 2006
Messages
2
Reaction score
0
Well, I asked the developer, needed a synchronous bind:

l.simple_bind_s(dn,oldpass)

as opposed to

l.simple_bind(dn,oldpass)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top