symfony/ldap
LDAP client for PHP built on the ldap extension, providing connection, querying, and entry management since Symfony 3.1. Stable and maintained within the Symfony ecosystem.
ldap extension behind a typed, object-oriented client (Adapter, Entry, Query, Collection) instead of raw ldap_* function calls scattered across the codebase. The decision it supports is "do we hand-roll bind/search/paginate logic, or adopt a maintained client and spend our engineering time on the product surface?" For most teams the latter wins because LDAP edge cases (paged results, referrals, TLS negotiation, attribute casing, binary attributes) are where custom implementations quietly accumulate bugs.whoami, it can underpin an SSO story without forcing a full SAML/OIDC identity-provider migration. That gives the roadmap a cheap intermediate step: "LDAP/AD auth in Q3, OIDC in Q4–Q1" rather than one large, risky identity project.Adapter is instantiable with arbitrary connection config, so a SaaS product can hold one directory configuration per tenant and construct a client per request. This directly supports the "each customer brings their own directory" enterprise tier.Adopt when:
UserProvider, a guard, a group-to-role mapping layer, connection caching. This package gives you the protocol work and deliberately stays out of your domain model.whoami — those are the features that separate this from a 40-line ldap_bind wrapper.php-ldap extension is compiled in — i.e., you control the container image or have confirmed it with your host. This is a hard dependency and a real adoption blocker on shared hosting and some managed PHP platforms.Look elsewhere when:
php-ldap cannot be installed. Non-negotiable.Risk notes the PM should carry forward, honestly:
symfony/symfony, not a signal of low adoption. Judge maturity by the release train, backport cadence, and the fact that Symfony Security's LDAP providers are built on it. Do not present star count to stakeholders as a quality metric either way.symfony/symfony monorepo, not this repository. Route support expectations accordingly; your team files against Symfony, and fixes ship on Symfony's schedule, not yours.AbstractQuery::sizeLimit was removed in 8.0, and Symfony 8 requires PHP ≥ 8.4. Budget for a pinning and upgrade policy up front.For executives — one paragraph:
Corporate buyers keep asking for Active Directory login, and today we either say no or build it from scratch each time. This package lets us connect to a customer's existing directory using a maintained Symfony component rather than custom protocol code — the same one Symfony's own security layer relies on. It's MIT-licensed, has shipped continuously across four maintained release lines with backported bugfixes, and carries no licensing cost. The trade-off is honest: it's an LDAP client, so our team still builds the Laravel-side login, user mapping, and group-to-role layer. Expect that as the bulk of the effort — but it's work we own and can reuse for every subsequent enterprise customer, versus per-deal custom integration. This is a sales-unblocking capability with a modest, bounded build cost, not a platform bet.
For engineering — the framing they'll want:
ldap_* calls and gives you typed Adapter/Entry/Query objects, paged queries, SASL bind, TLS, and whoami.UserProvider and guard, group→role mapping, per-tenant adapter construction, connection/serialization lifecycle (note the resettable-adapter support added in recent patches), and error handling for directory unavailability.php-ldap extension — verify in our base image first; this is step zero.sizeLimit, and majors have historically carried breaking changes.symfony/symfony monorepo — file issues there, and don't expect a fast lane for our specific needs.How can I help you explore Laravel packages today?