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

4

1 回答 1

2

我得到了解决方案。

    conn.protocol_version = ldap.VERSION3
    conn.set_option(ldap.OPT_REFERRALS, 0)

我在绑定发生之前添加了这两行

它奏效了……

于 2014-05-02T12:11:12.843 回答