Closed gabrielhmsantos closed 3 months ago
Hi @gabrielhmsantos,
Have you added the same connection instance into the Container
?
https://ldaprecord.com/docs/core/v3/connections#container
use LdapRecord\Container;
use LdapRecord\Connection;
$connection = new Connection([
// ...
]);
$connection->connect();
Container::addConnection($connection);
Also, are you using the Laravel integration, or just the core LdapRecord framework?
Thank you very much, as I am developing an application that fetches connection data from the DB, it does not use the .env which is clean (the Ldap variables), and that is why I was not connecting to the Default Container.
To resolve this, I created a /default endpoint that defines the Container according to the AD aliases
Great, glad you're up and running @gabrielhmsantos! Happy to help 👍
Environment:
LDAP Server Type: ActiveDirectory PHP Version: 8.2.4 LDAPS: true
Describe the bug:
I'm having a problem when trying to use the search for ActiveDirectory with User::findBy(), laravel returns me:
ldap_search(): Search: Can't contact LDAP server
But if I use $connection->query()->findByOrFail() it normally searches for information from AD users.
What I can say about my environment is that it is an EntraID replication environment, does this affect how LdapRecord handles information?
If it's something related to the model, how can I "remap" the model to ActiveDirectory?