55use Symfony \Component \Ldap \Adapter \QueryInterface ;
66use Symfony \Component \Ldap \Entry ;
77use Symfony \Component \Security \Core \Exception \UnsupportedUserException ;
8- use Symfony \Component \Security \Core \Exception \UsernameNotFoundException ;
8+ use Symfony \Component \Security \Core \Exception \UserNotFoundException ;
99use Symfony \Component \Security \Core \User \UserInterface ;
1010use Symfony \Component \Security \Core \User \UserProviderInterface ;
1111use Mapbender \LDAPBundle \Security \LdapClient ;
@@ -65,7 +65,7 @@ public function loadUserByIdentifier(string $username): UserInterface
6565 // skips to the next provider, if any
6666 /** @see \Symfony\Component\Security\Core\User\ChainUserProvider::loadUserByUsername() */
6767 if (!$ this ->client ->getHost ()) {
68- throw new UsernameNotFoundException ('LDAP lookup disabled with empty host configuration ' , 0 );
68+ throw new UserNotFoundException ('LDAP lookup disabled with empty host configuration ' , 0 );
6969 }
7070
7171 $ this ->client ->bind ();
@@ -76,7 +76,7 @@ public function loadUserByIdentifier(string $username): UserInterface
7676 $ roles = $ this ->findLdapUserRoles ($ results [0 ]);
7777 return new LdapUser ($ username , $ roles );
7878 } else {
79- throw new UsernameNotFoundException (sprintf ('User "%s" could not be fetched from LDAP. ' , $ username ), 0 );
79+ throw new UserNotFoundException (sprintf ('User "%s" could not be fetched from LDAP. ' , $ username ), 0 );
8080 }
8181 }
8282
0 commit comments