diff options
author | Charles Sarrazin <charles@sarraz.in> | 2016-01-28 14:54:41 +0100 |
---|---|---|
committer | Charles Sarrazin <charles@sarraz.in> | 2016-02-11 18:54:23 +0100 |
commit | a07df7b1ba2f304191e4b2232072f34475bd5bcc (patch) | |
tree | 5c14602213e50803d6ae1b50b83d2e8cccebc0fa /Core/Authentication | |
parent | b5c4b14ce46387314b6bd17f13ac151b446c6847 (diff) | |
download | symfony-security-a07df7b1ba2f304191e4b2232072f34475bd5bcc.zip symfony-security-a07df7b1ba2f304191e4b2232072f34475bd5bcc.tar.gz symfony-security-a07df7b1ba2f304191e4b2232072f34475bd5bcc.tar.bz2 |
Improved the Ldap Component
* Moved connection logic to dedicated class
* Added support for Ldap result entries iterator and renamed LdapClient to Ldap
* Added support for multiple adapters
* Attempt anonymous bind if the connection is not bound beforehand
* Finalized API
* Updated the Security component to use v3.1 of the Ldap component
* Updated unit tests
* Added support for functional tests
* Updated README file
Diffstat (limited to 'Core/Authentication')
-rw-r--r-- | Core/Authentication/Provider/LdapBindAuthenticationProvider.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Core/Authentication/Provider/LdapBindAuthenticationProvider.php b/Core/Authentication/Provider/LdapBindAuthenticationProvider.php index 7283ab9..950b603 100644 --- a/Core/Authentication/Provider/LdapBindAuthenticationProvider.php +++ b/Core/Authentication/Provider/LdapBindAuthenticationProvider.php @@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; -use Symfony\Component\Ldap\LdapClientInterface; +use Symfony\Component\Ldap\LdapInterface; use Symfony\Component\Ldap\Exception\ConnectionException; /** @@ -40,11 +40,11 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider * @param UserProviderInterface $userProvider A UserProvider * @param UserCheckerInterface $userChecker A UserChecker * @param string $providerKey The provider key - * @param LdapClientInterface $ldap An Ldap client + * @param LdapInterface $ldap A Ldap client * @param string $dnString A string used to create the bind DN * @param bool $hideUserNotFoundExceptions Whether to hide user not found exception or not */ - public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapClientInterface $ldap, $dnString = '{username}', $hideUserNotFoundExceptions = true) + public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapInterface $ldap, $dnString = '{username}', $hideUserNotFoundExceptions = true) { parent::__construct($userChecker, $providerKey, $hideUserNotFoundExceptions); @@ -74,7 +74,7 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider $password = $token->getCredentials(); try { - $username = $this->ldap->escape($username, '', LDAP_ESCAPE_DN); + $username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN); $dn = str_replace('{username}', $username, $this->dnString); $this->ldap->bind($dn, $password); |