Skip to content

Commit 1d847b4

Browse files
committed
feature symfony#54604 [Ldap] Improve error reporting during LDAP bind (RoSk0)
This PR was merged into the 7.1 branch. Discussion ---------- [Ldap] Improve error reporting during LDAP bind | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | | License | MIT In some rare edge-case where there are issue binding to the LDAP server, for example where the error code doesn't match known error codes in `\Symfony\Component\Ldap\Adapter\ExtLdap\Connection::bind()` it would be very useful to get any additional information available. Commits ------- efeb72b Improve error reporting during LDAP bind
2 parents b0724ba + efeb72b commit 1d847b4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public function bind(?string $dn = null, #[\SensitiveParameter] ?string $passwor
7878
case self::LDAP_ALREADY_EXISTS:
7979
throw new AlreadyExistsException($error);
8080
}
81-
throw new ConnectionException($error);
81+
ldap_get_option($this->connection, LDAP_OPT_DIAGNOSTIC_MESSAGE, $diagnostic_message);
82+
throw new ConnectionException($error.' '.$diagnostic_message);
8283
}
8384

8485
$this->bound = true;

src/Symfony/Component/Ldap/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.1
5+
---
6+
7+
* Improve error reporting during LDAP bind
8+
49
7.0
510
---
611

0 commit comments

Comments
 (0)