Fix #1311 (Enable LDAP Anonymous Login)

This commit is contained in:
Ozzieisaacs
2020-04-18 11:48:34 +02:00
parent 195845ab0c
commit 06fde4fcd0
20 changed files with 1462 additions and 1173 deletions
+4 -4
View File
@@ -48,11 +48,11 @@ def init_app(app, config):
config.config_ldap_serv_password = ''
app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password)
else:
app.config['LDAP_PASSWORD'] = base64.b64decode("''")
app.config['LDAP_PASSWORD'] = base64.b64decode("")
app.config['LDAP_USERNAME'] = config.config_ldap_serv_username
else:
app.config['LDAP_USERNAME'] = "''"
app.config['LDAP_PASSWORD'] = base64.b64decode("''")
app.config['LDAP_USERNAME'] = ""
app.config['LDAP_PASSWORD'] = base64.b64decode("")
if bool(config.config_ldap_cert_path):
app.config['LDAP_REQUIRE_CERT'] = True
app.config['LDAP_CERT_PATH'] = config.config_ldap_cert_path
@@ -96,7 +96,7 @@ def bind_user(username, password):
log.debug("LDAP login '%s': %r", username, result)
return result is not None, None
return None, None # User not found
except (TypeError, AttributeError) as ex:
except (TypeError, AttributeError, KeyError) as ex:
error = ("LDAP bind_user: %s" % ex)
return None, error
except LDAPException as ex: