added a missing check for the provider key

This commit is contained in:
Fabien Potencier 2013-05-05 18:35:57 +02:00
parent b0e3ea5f5f
commit 5b7e1e6f68

View File

@ -47,7 +47,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
}
/**
* Handles X509 authentication.
* Handles pre-authentication.
*
* @param GetResponseEvent $event A GetResponseEvent instance
*/
@ -62,7 +62,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
list($user, $credentials) = $this->getPreAuthenticatedData($request);
if (null !== $token = $this->securityContext->getToken()) {
if ($token instanceof PreAuthenticatedToken && $token->isAuthenticated() && $token->getUsername() === $user) {
if ($token instanceof PreAuthenticatedToken && $this->providerKey == $token->getProviderKey() && $token->isAuthenticated() && $token->getUsername() === $user) {
return;
}
}