summaryrefslogtreecommitdiffstats
path: root/Core/Authentication
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-02-27 22:20:44 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2011-02-27 22:20:44 +0100
commit2112fd92a0f96fe9cbdc975e86dcfab9e6debcf7 (patch)
tree940876393824ace9d1429f61b14dddacfc5bbbac /Core/Authentication
parentb3817718baeb272b197cddd81e6e7610d50395b3 (diff)
parent21a2bb31ee8ef588972380940f17096e57a065fd (diff)
downloadsymfony-security-2112fd92a0f96fe9cbdc975e86dcfab9e6debcf7.zip
symfony-security-2112fd92a0f96fe9cbdc975e86dcfab9e6debcf7.tar.gz
symfony-security-2112fd92a0f96fe9cbdc975e86dcfab9e6debcf7.tar.bz2
Merge remote branch 'schmittjoh/security'
* schmittjoh/security: [Security] added method to retrieve the configured remember-me parameter [Security] Copy token attributes when auth providers create a new token from another
Diffstat (limited to 'Core/Authentication')
-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);