diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 408656047f51b7b52b24bcbfab5ef6159192b846..e7975bfbe3b02bdf82c5ebd5d5cb6dc425759afc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,8 @@ Fixed * Show all years in a 200 year range around the current year in date pickers * Imprint is now called "Imprint" and not "Impress". * Logo files weren't uploaded to public namespace. +* Limit LDAP network timeouts to not hang indefinitely on login if LDAP + server is unreachable Changed ~~~~~~~ diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 94971e5c5bbc11277afc245720b12ed8ab979a01..4b49ed50c9c1b8217b36871fce005fff661de4c4 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -405,6 +405,10 @@ if _settings.get("ldap.uri", None): PosixGroupType, ) + AUTH_LDAP_GLOBAL_OPTIONS = { + ldap.OPT_NETWORK_TIMEOUT: _settings.get("ldap.network_timeout", 3), + } + # Enable Django's integration to LDAP AUTHENTICATION_BACKENDS.append("aleksis.core.util.ldap.LDAPBackend")