mirror of
https://github.com/jdupouy/radicale3-auth-ldap.git
synced 2024-10-27 19:14:00 +00:00
multiple ldap servers can be defined in ldap_url
This commit is contained in:
parent
a396d8da41
commit
b71adb30ec
@ -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
|
||||
|
@ -46,6 +46,9 @@ class Auth(BaseAuth):
|
||||
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)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user