Installation#
Prerequisites#
- Drupal 9.3 through 11 (
core_version_requirementon the modules). - The PHP LDAP extension (
ext-ldap) on the web runtime. - Access details from your directory team: host, port, encryption, bind
method, and the unique user attribute (for example
sAMAccountNameon Active Directory, oftenuidorcnon OpenLDAP).
Install the PHP LDAP extension using your platform’s documentation (DDEV, Debian packages, and so on). Do not copy generic PHP compile steps into this site.
Composer dependencies include symfony/ldap, drupal/externalauth, and
drupal/authorization (needed when you enable LDAP Authorization).
Enable modules#
- Enable LDAP Servers.
- Add a server under Configuration → People → LDAP → Servers
(
/admin/config/people/ldap/server) until the list reports it available. See Configure a server. - Enable LDAP Users (this enables LDAP Query as well). Configure
provision servers and mappings under
/admin/config/people/ldap/user. - Enable LDAP Authentication. Configure mixed vs exclusive mode under
/admin/config/people/ldap/authentication. - Confirm a real directory user can log in, then enable Authorization and LDAP Authorization.
The LDAP admin hub is /admin/config/people/ldap. The permission is
Administer LDAP (administer ldap).
Keep bind passwords out of exported config#
Put a dummy password on the server entity and override it in settings.php
so credentials are not in the database or config export:
1 2 | |
YOUR_SERVER is the server entity machine name. You can include a file
outside the web root that sets these overrides. The server edit form shows
the same snippets and flags detected overrides.