using python_ldap for authentication

tooper googlenews at
Wed Aug 31 16:34:42 CEST 2005

Hello all,

I'd like to use an ldap server just for authentication, but I'm a
complete beginner with all the ldap stuff...

I've tried this from the python_ldap Demo examples :

import ldap, getpass

ldap_url="... validation ldap server URL & port ..."
l = ldap.initialize(ldap_url)

login_dn = "cn=thierry"
login_pw = getpass.getpass("Password for %s: " % login_dn)
l.simple_bind(login_dn, login_pw)

but it seems to succeed whatever the password I'm providing :-(

How to simply assess the binding really occured ?
Do I need to start doing stuff with the "l" object to catch an error
and realize I'm not in fact connected : that's my current workaround
but I'm not very proud of it...

Thanks in advance !

More information about the Python-list mailing list