From a3436d114602989b3ad13d220c1469bdc055262f Mon Sep 17 00:00:00 2001 From: Josue-T Date: Thu, 13 Dec 2018 15:58:00 +0100 Subject: [PATCH] [fix] Automatically reconnect LDAP authenticator when slapd restarts (#185) * Fix LDAP authenticator when slapd was restarted * Update parameter for LDAP reconnection --- moulinette/authenticators/ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moulinette/authenticators/ldap.py b/moulinette/authenticators/ldap.py index 8484e491..0c3d4d7a 100644 --- a/moulinette/authenticators/ldap.py +++ b/moulinette/authenticators/ldap.py @@ -76,7 +76,7 @@ class Authenticator(BaseAuthenticator): def authenticate(self, password): try: - con = ldap.initialize(self.uri) + con = ldap.ldapobject.ReconnectLDAPObject(self.uri, retry_max=10, retry_delay=0.5) if self.userdn: con.simple_bind_s(self.userdn, password) else: