Do not interrupt authentication chain on invalid ldap connection infos
Catch LdapExceptions and throw AuthenticationException to not interrupt authentication chain fixes #7497
This commit is contained in:
parent
18bd49e636
commit
f9fee2df70
|
@ -68,8 +68,16 @@ class LdapUserBackend extends UserBackend
|
|||
*/
|
||||
public function assertAuthenticationPossible()
|
||||
{
|
||||
$q = $this->conn->select()->from($this->userClass);
|
||||
$result = $q->fetchRow();
|
||||
try {
|
||||
$q = $this->conn->select()->from($this->userClass);
|
||||
$result = $q->fetchRow();
|
||||
} catch (LdapException $e) {
|
||||
throw new AuthenticationException(
|
||||
'Connection not possible: %s',
|
||||
$e->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
if (! isset($result)) {
|
||||
throw new AuthenticationException(
|
||||
'No objects with objectClass="%s" in DN="%s" found.',
|
||||
|
@ -158,7 +166,7 @@ class LdapUserBackend extends UserBackend
|
|||
} catch (AuthenticationException $e) {
|
||||
// Authentication not possible
|
||||
throw new AuthenticationException(
|
||||
'Authentication against backend "%s" not possible: ',
|
||||
'Authentication against backend "%s" not possible: %s',
|
||||
$this->getName(),
|
||||
$e
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue