2284: ldap authentication with anonymous bind fails due to referrals

eiv****@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 8, 2011
What version are you running?
1.5.6

What steps will reproduce the problem?

When authenticating by LDAP against a windows domain controller, using an "anonymous user", the search operation fails if the ldap server replies with a referral.

See http://www.python-ldap.org/faq.shtml, question 12 for more details.

I've fixed this by adding 
            ldapo.set_option(ldap.OPT_REFERRALS, 0)
in backends.py:LDAPBackend.authenticate and LDAPBackend.get_or_create_user (just after setting protocol version).

Maybe a better fix would be to set this only if LDAP_ANON_BIND_UID is set.

What is the expected output? What do you see instead?

This is the logged error message:

2011-09-14 09:03:17,800 - WARNING - LDAP error: {'info': '000004DC: LdapErr: DSI
D-0C0906DD, comment: In order to perform this operation a successful bind must b
e completed on the connection., data 0, v1772', 'desc': 'Operations error'}


What operating system are you using? What browser?

Gentoo linux.
chipx86
#1 chipx86
This was added on 1.6.
  • +Fixed
  • +Milestone-Release1.6
    +Component-Accounts