DirectoryTree / LdapRecord

A fully-featured LDAP framework.
https://ldaprecord.com
MIT License
512 stars 44 forks source link

Why login return false connection ? #713

Closed Mohammed-800 closed 5 months ago

Mohammed-800 commented 5 months ago
image
stevebauman commented 5 months ago

Hi @Mohammed-800,

The username of the user is incorrect. For the forumsys test server, account names have of the attribute of uid:

use LdapRecord\Connection;

$conn = new Connection([
    "hosts" => ["ldap.forumsys.com"],
    "username" => "cn=read-only-admin,dc=example,dc=com",
    "password" => "password",
    "base_dn" => "dc=example,dc=com"
]);

$conn->connect();

$conn->auth()->attempt("uid=euler,dc=example,dc=com", "password");