[python-ldap] Help for get exception

Avner Gonçalves avner.goncalves at s2it.com.br
Wed Nov 27 19:16:50 CET 2013


Hello,
I run this command in line for terminar:
"ldapwhoami -x -D "cn=XXXXXX,ou=People,dc=XXXXXX,dc=com" -e ppolicy -w XXXXXX"

Return:
"ldap_bind: Invalid credentials (49); Password expired"

I need run this code:

try:
    l = ldap.open("127.0.0.1")
    l.protocol_version = ldap.VERSION3

    username  = "cn=XXXXXX,ou=People,dc=XXXXXX,dc=com"
    password  = "XXXXXX"

    msgid = l.simple_bind_s(username,password)
    print msgid;

except ldap.LDAPError, e:
    print 'Simple bind failed:',str(e)
    sys.exit(1)

And return:
"Simple bind failed: {'desc': 'Invalid credentials'}"


How i get this execption "Password expired" ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20131127/089946c7/attachment.html>


More information about the python-ldap mailing list