diff options
author | Johannes Schmitt <schmittjoh@gmail.com> | 2011-02-26 21:47:57 +0100 |
---|---|---|
committer | Johannes Schmitt <schmittjoh@gmail.com> | 2011-02-26 21:47:57 +0100 |
commit | 21a2bb31ee8ef588972380940f17096e57a065fd (patch) | |
tree | d90a311c8e7b402a7656f6b3f7d124ce410645d8 | |
parent | b545e06f5c4c1defad1e0ea81a23099b57394e67 (diff) | |
parent | 1625a8e936f747bca3390680c5452af34e06ad97 (diff) | |
download | symfony-security-21a2bb31ee8ef588972380940f17096e57a065fd.zip symfony-security-21a2bb31ee8ef588972380940f17096e57a065fd.tar.gz symfony-security-21a2bb31ee8ef588972380940f17096e57a065fd.tar.bz2 |
Merge branch 'CopyTokenAttributesInProviders' of https://github.com/opensky/symfony into opensky-CopyTokenAttributesInProviders
-rw-r--r-- | Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php | 5 | ||||
-rw-r--r-- | Core/Authentication/Provider/UserAuthenticationProvider.php | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index 17443b9..c67e586 100644 --- a/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -68,7 +68,10 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn $this->accountChecker->checkPostAuth($user); - return new PreAuthenticatedToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); + $authenticatedToken = new PreAuthenticatedToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); + $authenticatedToken->setAttributes($token->getAttributes()); + + return $authenticatedToken; } /** diff --git a/Core/Authentication/Provider/UserAuthenticationProvider.php b/Core/Authentication/Provider/UserAuthenticationProvider.php index 6947de3..d59a386 100644 --- a/Core/Authentication/Provider/UserAuthenticationProvider.php +++ b/Core/Authentication/Provider/UserAuthenticationProvider.php @@ -70,7 +70,10 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter $this->checkAuthentication($user, $token); $this->accountChecker->checkPostAuth($user); - return new UsernamePasswordToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); + $authenticatedToken = new UsernamePasswordToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); + $authenticatedToken->setAttributes($token->getAttributes()); + + return $authenticatedToken; } catch (UsernameNotFoundException $notFound) { if ($this->hideUserNotFoundExceptions) { throw new BadCredentialsException('Bad credentials', 0, $notFound); |