Skip to content

Commit 2632bf8

Browse files
committed
doc: add documentation for USER_SEARCHES
1 parent be07be4 commit 2632bf8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

docs/application-settings.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,42 @@ It must return exactly one result for authentication to succeed.
383383
AUTH_LDAP_USER_DN="ou=users,dc=example,dc=com"
384384
AUTH_LDAP_USER_FILTERSTR="(uid=%(user)s)"
385385
386+
USER_SEARCHES
387+
-------------
388+
389+
To search across multiple LDAP locations, use
390+
``AUTH_LDAP_USER_SEARCHES``.
391+
392+
When this setting is provided, it overrides both
393+
``AUTH_LDAP_USER_DN`` and ``AUTH_LDAP_USER_FILTERSTR``.
394+
395+
The setting must contain a JSON list of search definitions. Each entry
396+
must define:
397+
398+
- ``base``: The base DN to search
399+
- ``filter``: The LDAP filter (must include ``%(user)s``)
400+
401+
All configured searches are combined using ``LDAPSearchUnion``.
402+
403+
Example:
404+
405+
.. code-block:: python
406+
407+
AUTH_LDAP_USER_SEARCHES = """
408+
[
409+
{
410+
"base": "ou=users,dc=example,dc=com",
411+
"filter": "(uid=%(user)s)"
412+
},
413+
{
414+
"base": "ou=otherusers,dc=example,dc=com",
415+
"filter": "(uid=%(user)s)"
416+
}
417+
]
418+
"""
419+
420+
For usage in a ``docker.env`` file only a single line string is accepted.
421+
386422
AUTOCREATE_USER
387423
---------------
388424

0 commit comments

Comments
 (0)