LDAP Query library - helps with querying/authenticating against LDAP/AD
This software is open-sourced software licensed under the MIT license
LdapQuery\Contracts\Backend
- handles setting up defaults for the connection and returning
query results, uses LdapQuery\Contracts\Client
and LdapQuery\Contracts\Result
LdapQuery\Contracts\Builder
- query builder, uses LdapQuery\Contracts\Filter
to create backend specific
query/filterLdapQuery\Contracts\Client
- proxy to actual ldap_ functions (or whatever the lower level backend is)LdapQuery\Contracts\Model
- simple object to represent ldap entry, returned from LdapQuery\Contracts\Result
LdapQuery\Contracts\Result
- uses LdapQuery\Contracts\Builder
to create a form that is useful to
LdapQuery\Contracts\Client
and returns the result from the client in LdapQuery\Contracts\Model
formLdapQuery\Contracts\Filter
- used by LdapQuery\Contracts\Builder
to set up the possible filtersLdapQuery\Opinionated\ActiveDirectory
is an example of how the LdapQuery can be wired for AD. It can all be
done manually or through DI as well.
$o = new ActiveDirectory([
'host' => 'foo.bar.com',
]);
$lq = $o->getLdapQuery();
if ($sut->authenticate('user', 'password')) {
//do something when the user is successfully authenticated
}
$user = $lq->findUser('user');
$another = $lq->one('uid', 'some_user');
$many = $lq->many('l', 'some_location');