Authentik LDAP Provider
LDAP Provider: Link: https://docs.goauthentik.io/add-secure-apps/providers/ldap/
Create LDAP Provider: Link: https://docs.goauthentik.io/add-secure-apps/providers/ldap/create-ldap-provider/
Outposts: Link: https://docs.goauthentik.io/add-secure-apps/outposts/
Outposts Compose: link: https://docs.goauthentik.io/add-secure-apps/outposts/
Create an LDAP provider
Creating an authentik LDAP provider requires the following steps:
Create an LDAP authentication flow (optional)
The default-authentication-flow validates MFA by default. Duo, TOTP, and static authenticators are supported by the LDAP provider. WebAuthn and SMS are not supported.
If you plan to use only dedicated service accounts to bind to LDAP, or only use LDAP supported MFA authenticators, then you can use the default authentication flow and skip this section and continue with the Create an LDAP application and provider section.
Refer to Code-Based MFA support for more information on LDAP and MFA.
Create custom stages
You'll need to create the stages that make up the flow.
Password Stage
First, you'll need to create a Password Stage.
ldap-authentication-password-stage).
For Backends, leave the default settings.
Click Finish
Identification Stage
Next, you'll need to create an Identification Stage.
ldap-identification-stage).
For User fields, select Username and Email (and UPN if it is relevant to your setup).
Set Password stage to the Password Stage created in the previous section (e.g. ldap-authentication-password-stage)
Click Finish
User Login Stage
Finally, you'll need to create a User Login Stage.
ldap-authentication-login-stage).
Click Finish
Create an LDAP authentication flow
Now you'll need to create the LDAP authentication flow and bind the previously created stages.
ldap-authentication-flow).
Set Designation to Authentication.
Click Create.
Click the name of the newly created flow, open the Stage Bindings tab, and click Bind existing stage.
Select the previously created LDAP Identification Stage (e.g.ldap-identification-stage), set the order to 10, and click Create.
Click Bind existing stage.
Select the previously created LDAP User Login Stage (e.g.ldap-authentication-login-stage), set the order to 30, and click Create.
Create an LDAP application and provider
The LDAP application and provider can now be created.
If you followed the optional Create an LDAP authentication flow section, ensure that you set Bind flow to newly created authentication flow (e.g. ldap-authentication-flow).
Create a service account
Create a service account to bind to LDAP with.
ldapservice) and click Create.
Click the name of the newly created service account.
Under Recovery, click Set password, provide a secure password for the account, and click Update password.
The default DN of this user will be cn=ldapservice,ou=users,dc=ldap,dc=goauthentik,dc=io
Assign the LDAP search permission to the service account
The service account needs permissions to search the LDAP directory. You'll need to create a role with the permission and assign the service account to that role.
LDAP search) and then click Create.
Click on the newly created role and open the Users tab.
Click Add existing user, select the service account, and then click Assign.
Navigate to Applications > Providers.
Click on the name of the newly created LDAP provider and open the Permissions tab.
Click Assign Object Permissions.
Select the role that you created (e.g. LDAP search), enable the Search full LDAP directory permission, and then click Assign.
Create an LDAP Outpost
The LDAP provider requires the deployment of an LDAP Outpost.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Outposts, click Create and set the following required configurations:
LDAP.
Set Integration to match your deployment method or manually deploy an outpost via Docker-Compose or Kubernetes. For more information, refer to the Outpost documentation.
Under Applications, select the LDAP application created in the previous section.
Under Advanced settings, set the required outpost configurations. For more information, refer to Outpost Configuration
Click Create.
The LDAP Outpost selects different providers based on their Base DN. Adding multiple providers with the same Base DN will result in inconsistent access.
Configuration verification
You can test the LDAP provider by using the ldapsearch tool on Linux and macOS, or the dsquery tool on Windows.
To install the ldapsearch tool, use one of the following commands:
sudo apt-get install ldap-utils -y # Debian-based systems
sudo yum install openldap-clients -y # CentOS-based systems
brew install openldap #macOS based systems (requires Homebrew to be installed)
To search the LDAP directory using the previously created ldapservice service account, use the following command:
ldapsearch \
-x \
-H ldap://<LDAP outpost IP address>:389 \
-D 'cn=ldapservice,ou=users,DC=ldap,DC=goauthentik,DC=io' \
-w '<ldapuserpassword>' \
-b 'DC=ldap,DC=goauthentik,DC=io' \
'(objectClass=user)'
This example query will return all users and log the first successful attempt in an event in Events > Logs. Subsequent successful logins from the same user are not logged by default, as they are cached in the outpost. For more details see Bind modes.
In production it is recommended to use LDAPS, which requires ldaps:// as the protocol, and port number 636 rather than 389. See LDAPS for more information.