Request Lifecycle
The LDAP provider operates over TCP using the LDAP protocol (not HTTP). Each operation type has its own processing flow and hook point.Search
Simple Bind Authentication
Hooks
searchSE
Handle LDAP search requests by returning directory entries that match the query. Each entry maps a distinguished name (DN) to its attributes. Use this to implement custom search logic, query external directories, filter results, or build virtual directory entries from non-LDAP sources like databases or REST APIs.
Signature:
ldapProvider.search.searchSE
Parameters:
Returns:
map[string]map[string]interface{}— a map of DNs to attribute maps, where each attribute map contains the requested attribute name-value pairserror— returnnilon success, or an error if the search fails
authenticateSE
Authenticate a user via LDAP simple bind. Return true if the credentials are valid, or false to deny authentication. Use this to validate credentials against an external system, implement custom password policies, or bridge LDAP authentication to a non-LDAP identity store.
Signature:
ldapProvider.authentication.methods.simple.authenticateSE
Parameters:
Returns:
bool—trueif the credentials are valid,falseotherwiseerror— returnnilon success, or an error if the authentication process fails
Delegate simple bind to an IdP via ROPC
Delegate simple bind to an IdP via ROPC
When an LDAP client performs a simple bind, this extension extracts the
username from the bind DN and authenticates the user against an OIDC identity
provider using the Resource Owner Password Credentials (ROPC) grant. This
bridges LDAP authentication with a modern IdP without changes to the
client application.
- Extension
- Configuration
ldap-authenticate.go
Add TOTP multi-factor authentication to simple bind
Add TOTP multi-factor authentication to simple bind
Applications that authenticate via LDAP simple bind have no built-in way
to support multi-factor authentication. This extension works around that
limitation by treating the password field as a concatenation of the real
password and a TOTP code (e.g.,
myP@ssword12345678). The password portion
is verified against an IdP via ROPC, and the TOTP code is verified against
an external MFA API.- Extension
- Configuration
ldap-authenticate-totp.go
Related Pages
Service Extensions Overview
Configuration, SDK reference, and best practices
LDAP Provider Mode
LDAP provider mode configuration and setup