st2-auth-backend-ldap icon indicating copy to clipboard operation
st2-auth-backend-ldap copied to clipboard

feature request: support multiple servers (list)

Open johnarnold opened this issue 7 years ago • 4 comments

E.g. if one server/uri is not available, use the next one.

I guess the simplest way to implement would be a loop in authenticate() that just tries each one in the list until one will bind. Comments/thoughts on this approach?

johnarnold avatar Jul 10 '17 20:07 johnarnold

bump, this would be a great addition.

jmwaldrip avatar Aug 27 '18 19:08 jmwaldrip

@jmwaldrip this plugin is community-written & supported. PRs are welcome if you want to add those features.

LindsayHill avatar Aug 27 '18 19:08 LindsayHill

@LindsayHill Thanks for the information. As I have time, I will look at getting a PR submitted.

jmwaldrip avatar Aug 27 '18 19:08 jmwaldrip

ldap.initialize() func. in python-ldap can accept the list of urls as documented in https://www.python-ldap.org/en/python-ldap-3.2.0/reference/ldap.html#ldap.initialize

The uri parameter may be a comma- or whitespace-separated list of URIs containing only the schema, the host, and the port fields. Note that when using multiple URIs you cannot determine to which URI your client gets connected.

Then, we can configure for the multiple servers as

backend_kwargs = { "ldap_uri": "ldap://ldap1.example.com,ldap://ldap2.example.com,ldap://ldap3.example.com" ... }

I confirmed it works well even when the some of the listed ldap servers are down. We can improve the document, though.

mtatsuma avatar Feb 13 '20 04:02 mtatsuma