diff --git a/composer.json b/composer.json index 3bd5e20..0bcf980 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,8 @@ "simplesamlphp/simplesamlphp": "^2.2", "simplesamlphp/simplesamlphp-module-ldap": "^2.2", "symfony/http-foundation": "^6.4", - "symfony/ldap": "^6.4" + "symfony/ldap": "^6.4", + "symfony/security-core": "^6.4" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "^1.6.0" diff --git a/src/Auth/Source/X509userCert.php b/src/Auth/Source/X509userCert.php index 256d58f..aaa56b0 100644 --- a/src/Auth/Source/X509userCert.php +++ b/src/Auth/Source/X509userCert.php @@ -15,6 +15,7 @@ use SimpleSAML\Utils; use SimpleSAML\XHTML\Template; use Symfony\Component\Ldap\Entry; +use Symfony\Component\Ldap\Ldap; use Symfony\Component\Ldap\Security\LdapUserProvider; use Symfony\Component\Security\Core\Exception\UserNotFoundException; @@ -279,9 +280,10 @@ public function findUserByAttribute(string $attr, string $value): ?Entry Assert::nullOrnotWhitespaceOnly($searchPassword); $ldap = ConnectorFactory::fromAuthSource($this->backend); + $connection = new Ldap($ldap->getAdapter()); foreach ($searchBase as $base) { - $ldapUserProvider = new LdapUserProvider($ldap, $base, $searchUsername, $searchPassword, [], $attr); + $ldapUserProvider = new LdapUserProvider($connection, $base, $searchUsername, $searchPassword, [], $attr); try { return $ldapUserProvider->loadUserByIdentifier($value)->getEntry(); } catch (UserNotFoundException $e) { diff --git a/tools/composer-require-checker.json b/tools/composer-require-checker.json index 8a6e045..c98b9cd 100644 --- a/tools/composer-require-checker.json +++ b/tools/composer-require-checker.json @@ -2,7 +2,6 @@ "symbol-whitelist": [ "SimpleSAML\\Module\\ldap\\ConfigHelper", "SimpleSAML\\Module\\ldap\\ConnectorFactory", - "SimpleSAML\\Module\\ldap\\ConnectorInterface", - "Symfony\\Component\\Security\\Core\\Exception\\UserNotFoundException" + "SimpleSAML\\Module\\ldap\\ConnectorInterface" ] }