At a minimum, you must configure server_address and a method to resolve the user's Distinguished Name (DN).
1. Set the Server Address
LDAPAuthenticator.server_address: The hostname or IP of the LDAP server (do not include protocol or port).
2. Resolve the User DN
You have two primary methods to acquire the DN required for binding:
Method A: Using bind_dn_template (when lookup_dn = False)
If you know the structure of your DNs, provide a list of templates. The {username} placeholder is replaced by the user's input.
c.LDAPAuthenticator.bind_dn_template = [
"uid={username},ou=people,dc=wikimedia,dc=org",
"uid={username},ou=developers,dc=wikimedia,dc=org",
]
Method B: Using lookup_dn = True (Reverse Lookup)
This is recommended for servers like Active Directory where the DN is not easily predictable from the username. When lookup_dn = True, the authenticator performs a search to find the user's DN first.
Note: When using lookup_dn = True, you must also configure user_search_base, user_attribute, lookup_dn_user_dn_attribute, and lookup_dn_search_filter (though defaults may work).
c.LDAPAuthenticator.server_address = 'ldap.example.com'
c.LDAPAuthenticator.lookup_dn = True