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]
|
[auth]
|
||||||
type = radicale_auth_ldap
|
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_url = ldap://ldap:389
|
||||||
|
|
||||||
# LDAP base path
|
# LDAP base path
|
||||||
|
@ -45,6 +45,9 @@ class Auth(BaseAuth):
|
|||||||
PASSWORD = self.configuration.get("auth", "ldap_password")
|
PASSWORD = self.configuration.get("auth", "ldap_password")
|
||||||
SCOPE = self.configuration.get("auth", "ldap_scope")
|
SCOPE = self.configuration.get("auth", "ldap_scope")
|
||||||
SUPPORT_EXTENDED = self.configuration.getboolean("auth", "ldap_support_extended", fallback=True)
|
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:
|
if BINDDN and PASSWORD:
|
||||||
conn = ldap3.Connection(SERVER, BINDDN, PASSWORD)
|
conn = ldap3.Connection(SERVER, BINDDN, PASSWORD)
|
||||||
|
Loading…
Reference in New Issue
Block a user