My code:
l=ldap.initialize('ldap://x.x.x.x:389')
username = "myusername"
user_dn = "uid="+username+", dc=ananthtech,dc=com"
password = "mypassword"
try:
l.simple_bind_s(username, password)
valid = True
except Exception, error:
print error
But I get the following error:
{'info': '80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece', 'desc': 'Invalid credentials'}
eventhough I give valid username and password.
Note: Iam using Linux system and ldap server is in windows os
I got the solution.
conn.protocol_version = ldap.VERSION3
conn.set_option(ldap.OPT_REFERRALS, 0)
i have added these two lines before the bind takes place
and it worked...