summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Schmitt <schmittjoh@gmail.com>2011-02-26 21:47:57 +0100
committerJohannes Schmitt <schmittjoh@gmail.com>2011-02-26 21:47:57 +0100
commit21a2bb31ee8ef588972380940f17096e57a065fd (patch)
treed90a311c8e7b402a7656f6b3f7d124ce410645d8
parentb545e06f5c4c1defad1e0ea81a23099b57394e67 (diff)
parent1625a8e936f747bca3390680c5452af34e06ad97 (diff)
downloadsymfony-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.php5
-rw-r--r--Core/Authentication/Provider/UserAuthenticationProvider.php5
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);