Use simple bind method if LDAP accept anonymous bind
This commit is contained in:
parent
081d42d5cc
commit
4a0bd3de91
|
|
@ -176,6 +176,9 @@ class LDAPAuthHandler(AuthHandler):
|
||||||
# ldap_obj.set_option(ldap.OPT_REFERRALS, 0)
|
# ldap_obj.set_option(ldap.OPT_REFERRALS, 0)
|
||||||
|
|
||||||
ctx['action'] = 'binding as search user'
|
ctx['action'] = 'binding as search user'
|
||||||
|
if ctx['binddn'] == 'cn=anonymous':
|
||||||
|
ldap_obj.simple_bind_s()
|
||||||
|
else:
|
||||||
ldap_obj.bind_s(ctx['binddn'], ctx['bindpasswd'], ldap.AUTH_SIMPLE)
|
ldap_obj.bind_s(ctx['binddn'], ctx['bindpasswd'], ldap.AUTH_SIMPLE)
|
||||||
|
|
||||||
ctx['action'] = 'preparing search filter'
|
ctx['action'] = 'preparing search filter'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue