Expand description
LDAP Basic-auth plugin (ldap-auth).
Authenticates the request’s HTTP Basic credentials against an LDAP server by
performing a simple bind with the user’s DN and the presented password.
Port of APISIX’s ldap-auth plugin (the bind-authentication core of it).
Flow (matching apisix/plugins/ldap-auth.lua):
- Parse the
Authorization: Basic <base64(user:pass)>header. - Assemble the bind DN as
<uid>=<username>,<base_dn>. - Connect to
ldap_uriand attempt a simple bind with that DN + password. - Bind success → continue (
context.message["user"] = username); a missing header, malformed credentials, or a bind failure → 401LDAP_AUTH_FAILEDwith aWWW-Authenticate: Basicchallenge.
This is bind-auth, not search-then-bind: the DN is built directly from
uid/base_dn and no directory search is performed. See the Deviations in
website/docs/reference/plugins/ldap-auth.md.
Structs§
- Ldap
Auth Plugin - Authenticates HTTP Basic credentials against an LDAP server via simple bind.
Functions§
- build_
bind_ 🔒dn - Assembles the bind DN as
<uid>=<username>,<base_dn>(APISIX’suser_dn). - parse_
basic_ 🔒credentials - Parses an
Authorization: Basic ...header value into(username, password).