3

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

1 Answer 1

2

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...

Sign up to request clarification or add additional context in comments.

1 Comment

where did you add this code please ? I have the same problem. Thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.