Hi everyone,

Here is a sample code that works the first time I run the loop and fails the
second time with the following error. can someone let me know if the
credentials are cached by the library or what could be wrong? Any help is
greatly appreciated.

ldap.INVALID_CREDENTIALS: {'info': '80090308: LdapErr: DSID-0C09043E, comment:
AcceptSecurityContext error, data 57, vece', 'desc': 'Invalid credentials'}



import ldap, ldap.sasl


def main():
   while True:
        ldapServer="lserver"
        base ="ou=users,ou=accounts,dc=example,dc=com"
        user="user"
        passwd="pass"

        l = ldap.initialize(ldapServer)
        l.set_option(ldap.OPT_REFERRALS, 0)


        try:
            tok = ldap.sasl.digest_md5(user, passwd)
            l.sasl_interactive_bind_s("",tok)


        except ldap.INVALID_CREDENTIALS, e :

            print "Invalid Username or Password"
            print e
            return False
        print "success"
        l.unbind()



if __name__=="__main__":
     print "here"
     main()
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

Reply via email to