- What is newtondasilva/ldaptools-bundle used for?
- It is a Symfony bundle that packages the LdapTools library into ready-to-use container services and configuration. It lets a Symfony application connect to LDAP or Active Directory servers for authentication, user lookup, and general directory management. The goal is to avoid wiring LdapTools by hand in every project. If you are building on Symfony and need directory access, this bundle is the integration layer rather than a standalone LDAP client.
- Can I use newtondasilva/ldaptools-bundle in a Laravel application?
- No, not directly. It is a Symfony bundle and depends on Symfony's bundle and dependency injection machinery, so Laravel's container will not discover or boot it. Laravel projects needing LDAP typically use packages such as LdapRecord-Laravel or Adldap2-Laravel instead. You could reuse the underlying LdapTools library manually, but the bundle's services and configuration would not apply.
- How do I install newtondasilva/ldaptools-bundle?
- Install it with Composer by requiring newtondasilva/ldaptools-bundle in your Symfony project. Then register the bundle in your application's bundle configuration, which is bundles.php for Symfony Flex apps. After that, create the bundle's configuration file describing your directory connection. Check the README for the exact bundle class name and config file name before wiring things up.
- How do I configure the LDAP connection for this Symfony bundle?
- Connection settings such as the domain or host, port, base DN, and bind credentials go in your Symfony configuration under the bundle's config key. The bundle translates those settings into LdapTools connection objects used by the services it registers. For Active Directory you usually also specify the domain name so LdapTools can build correct distinguished names. Keep credentials out of version control by using environment variables or Symfony secrets.
- Which services does the bundle register in the Symfony container?
- The bundle exposes LdapTools' core objects, typically the LDAP connection and manager plus related helpers, as services in the Symfony container. That means you can inject them into your own services and controllers with autowiring instead of instantiating them yourself. Because it wraps LdapTools, the available objects mirror the underlying library's API. Check the bundle's service definitions for exact service IDs if you need to reference them manually.
- Can I authenticate users against Active Directory with it?
- Yes, the underlying LdapTools library supports bind-based authentication, which is how you validate a username and password against Active Directory or another directory. The bundle's role is to hand you a configured connection so your authenticator can perform that bind. A common pattern is a Symfony security authenticator that looks the user up in the directory and then attempts a bind with the supplied password. Use LDAPS or StartTLS, because a plain LDAP bind exposes credentials on the wire.
- Which Symfony and PHP versions does this bundle support?
- That depends on the bundle's composer.json constraints and on the version of LdapTools it pulls in. Small integration bundles like this one often lag behind framework releases, so verify the required Symfony major version before adding it to a Symfony 6 or 7 application. Run composer require and read the resolution output, or check Packagist for the constraint list. If the constraints block your framework version, using LdapTools directly is usually the simpler path.
- Can I create, update, or delete directory entries with this bundle?
- LdapTools itself supports directory operations such as adding, modifying, and removing entries, and the bundle gives you configured access to those objects. How much of that API is exposed through the bundle's own services depends on what the bundle wraps. In most cases you can inject the manager service and call the library's documented methods directly. Always rehearse write operations against a staging directory before touching production.
- How can I test LDAP integration without a real directory server?
- Unit-test the classes that consume the bundle's services by mocking or stubbing the injected LdapTools objects so your tests never hit the network. For end-to-end coverage, run a containerised directory such as OpenLDAP in CI and point the configuration at it. Keeping connection settings in environment-driven config makes it easy to switch between test and production targets.
- Is newtondasilva/ldaptools-bundle maintained, and what are the alternatives?
- Check the repository's commit history and Packagist release tags before committing to it, since small integration bundles often fall behind framework releases. Alternatives include using the LdapTools library directly, Symfony's own Ldap component with its LDAP user provider, or for Laravel projects LdapRecord-Laravel. If the bundle is unmaintained but you only need simple bind authentication, Symfony's built-in LDAP support is the lower-risk option.