summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorRomain Neutron <imprec@gmail.com>2014-09-26 11:21:57 +0200
committerRomain Neutron <imprec@gmail.com>2014-09-26 11:21:57 +0200
commit0268d3e6acd0a993bb72cf632cb85703b893b80a (patch)
treeb9c54a879d10bd5ab7ad23d8bf132fd9809ba2b1 /Http
parent16ccb3bf269521af5643927e79b5b3d0eeeefe92 (diff)
downloadsymfony-security-0268d3e6acd0a993bb72cf632cb85703b893b80a.zip
symfony-security-0268d3e6acd0a993bb72cf632cb85703b893b80a.tar.gz
symfony-security-0268d3e6acd0a993bb72cf632cb85703b893b80a.tar.bz2
[Security] Fix BC break introduces in #10694
Diffstat (limited to 'Http')
-rw-r--r--Http/Firewall/AnonymousAuthenticationListener.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Http/Firewall/AnonymousAuthenticationListener.php b/Http/Firewall/AnonymousAuthenticationListener.php
index 986c9a8..72f0071 100644
--- a/Http/Firewall/AnonymousAuthenticationListener.php
+++ b/Http/Firewall/AnonymousAuthenticationListener.php
@@ -31,7 +31,7 @@ class AnonymousAuthenticationListener implements ListenerInterface
private $authenticationManager;
private $logger;
- public function __construct(SecurityContextInterface $context, $key, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger = null)
+ public function __construct(SecurityContextInterface $context, $key, LoggerInterface $logger = null, AuthenticationManagerInterface $authenticationManager = null)
{
$this->context = $context;
$this->key = $key;
@@ -51,7 +51,10 @@ class AnonymousAuthenticationListener implements ListenerInterface
}
try {
- $token = $this->authenticationManager->authenticate(new AnonymousToken($this->key, 'anon.', array()));
+ if (null !== $this->authenticationManager) {
+ $token = $this->authenticationManager->authenticate(new AnonymousToken($this->key, 'anon.', array()));
+ }
+
$this->context->setToken($token);
if (null !== $this->logger) {