Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ldap Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Provides a LDAP client for PHP on top of PHP's ldap extension

Frequently asked questions about Ldap
Can I use symfony/ldap for Laravel authentication out of the box?
No. symfony/ldap is a low-level LDAP client, not an authentication framework. Laravel expects a Guard, UserProvider, password broker, and session lifecycle, and none of those ship with this package. You must write a custom wrapper and an Illuminate\Contracts\Auth\UserProvider to turn binds and searches into Laravel login.
How do I install and configure symfony/ldap in a Laravel app?
Install it with composer require symfony/ldap and confirm the PHP ldap extension is enabled. There is no Laravel auto-discovery, config publishing, or facade. Bind the Adapter or Ldap connection as a singleton in a dedicated service provider and inject it into your LDAP client wrapper.
Does symfony/ldap work with Laravel Octane and long-running queue workers?
Yes, but you must manage connection state. The Adapter is resettable in 6.4.36, 7.4.8, and 8.0.8, which matters for Octane and long-lived queue workers where a stale bind or dead socket can poison the worker. Call reset appropriately or rebuild the connection between requests and jobs.
Which PHP and Symfony versions are required for symfony/ldap?
Symfony 8.x requires PHP 8.4 or newer, Symfony 7.x requires PHP 8.2 or newer, and Symfony 6.4 is the LTS line. Match the symfony/ldap major to the Symfony transitive dependency Laravel already pulls in to avoid resolver conflicts and duplicate component trees.
How do I stop empty-password binds from authenticating users with symfony/ldap?
Reject blank passwords in your Laravel UserProvider before calling bind. An empty-password bind can succeed as an anonymous bind, a well-known LDAP authentication bypass, and symfony/ldap will not prevent it for you. Treat blank credentials as invalid and log the attempt without counting it as a bad password.
Is the PHP ldap extension required for symfony/ldap?
Yes. ext-ldap is a hard, non-negotiable requirement; the package is unusable without it. Many shared hosts disable it, and slim or Alpine containers need openldap-dev at build time plus the extension installed. Verify local, CI, and production environments before committing.
How do I map LDAP groups to Laravel roles using symfony/ldap?
Search for the user entry, read group membership attributes, and map those groups to Laravel roles in your own provider or service. symfony/ldap gives you Query, Entry, and Collection primitives for this, but no role mapping or authorization policy. You own the group-to-role rules and any just-in-time user provisioning.
Does symfony/ldap support Active Directory paging, SASL, and nested groups?
Partly. SASL bind and whoami were added in 7.2, but paged results are not a first-class API and Active Directory nested group expansion is not fully covered. Directories with more than 1000 entries will hit AD's default search size limit and need paging work. Expect to drop to native ldap_* calls for advanced server controls and referrals.
Should I use symfony/ldap instead of a Laravel-specific LDAP package?
Use symfony/ldap if you want a maintained, framework-agnostic LDAP primitive and are prepared to own the Laravel auth bridge. It is MIT-licensed, community-supported, and looking for a backer, so there is no vendor SLA. A Laravel-specific package may save time if you need a ready-made Guard, UserProvider, and configuration; symfony/ldap carries roughly 20% of the integration effort, while your custom Laravel code carries the rest.
How should I handle LDAP connection and bind failures in a Laravel login flow?
Distinguish wrong credentials from directory outages in your application logic. A failed bind for a valid username should be a 401 and may count toward lockout policy, while an unreachable directory should be a 503 and must not count. Getting this wrong causes retry-storm lockouts or spurious lockouts of valid users.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource