diff --git a/src/Auth/Source/X509userCert.php b/src/Auth/Source/X509userCert.php index a4cff35..d9f01f6 100644 --- a/src/Auth/Source/X509userCert.php +++ b/src/Auth/Source/X509userCert.php @@ -277,8 +277,8 @@ public function findUserByAttribute(string $attr, string $value): ?Entry { $searchBase = $this->ldapConfig->getArray('search.base'); - $searchUsername = $this->ldapConfig->getString('search.username'); - Assert::notWhitespaceOnly($searchUsername); + $searchUsername = $this->ldapConfig->getOptionalString('search.username', null); + Assert::nullOrnotWhitespaceOnly($searchUsername); $searchPassword = $this->ldapConfig->getOptionalString('search.password', null); Assert::nullOrnotWhitespaceOnly($searchPassword);