diff --git a/README.md b/README.md index 7d4a4be..2ede9a9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ You will need to set a few options inside your radicale config file. Example: [auth] type = radicale_auth_ldap -# LDAP server URL, with protocol and port +# LDAP server URL, with protocol and port (multiple servers can be separated by spaces) ldap_url = ldap://ldap:389 # LDAP base path diff --git a/radicale_auth_ldap/__init__.py b/radicale_auth_ldap/__init__.py index 55ed3d5..f940e4c 100644 --- a/radicale_auth_ldap/__init__.py +++ b/radicale_auth_ldap/__init__.py @@ -45,6 +45,9 @@ class Auth(BaseAuth): PASSWORD = self.configuration.get("auth", "ldap_password") SCOPE = self.configuration.get("auth", "ldap_scope") SUPPORT_EXTENDED = self.configuration.getboolean("auth", "ldap_support_extended", fallback=True) + + if ' ' in SERVER: # Handle if multiple LDAP server is defined in ldap_url with space separation + SERVER = SERVER.split(' ') # ldap3.connection can handle multiple servers in a list as an implicit server pool if BINDDN and PASSWORD: conn = ldap3.Connection(SERVER, BINDDN, PASSWORD)