|
14 | 14 | use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
|
15 | 15 | use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
|
16 | 16 | use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
| 17 | +use Symfony\Component\DependencyInjection\Definition; |
17 | 18 | use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
18 | 19 | use Symfony\Component\DependencyInjection\Alias;
|
19 | 20 | use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
@@ -100,16 +101,16 @@ public function load(array $configs, ContainerBuilder $container)
|
100 | 101 |
|
101 | 102 | // add some required classes for compilation
|
102 | 103 | $this->addClassesToCompile(array(
|
103 |
| - 'Symfony\\Component\\Security\\Http\\Firewall', |
104 |
| - 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface', |
105 |
| - 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager', |
106 |
| - 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage', |
107 |
| - 'Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManager', |
108 |
| - 'Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationChecker', |
109 |
| - 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface', |
110 |
| - 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap', |
111 |
| - 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallContext', |
112 |
| - 'Symfony\\Component\\HttpFoundation\\RequestMatcher', |
| 104 | + 'Symfony\Component\Security\Http\Firewall', |
| 105 | + 'Symfony\Component\Security\Core\User\UserProviderInterface', |
| 106 | + 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', |
| 107 | + 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage', |
| 108 | + 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager', |
| 109 | + 'Symfony\Component\Security\Core\Authorization\AuthorizationChecker', |
| 110 | + 'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface', |
| 111 | + 'Symfony\Bundle\SecurityBundle\Security\FirewallMap', |
| 112 | + 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', |
| 113 | + 'Symfony\Component\HttpFoundation\RequestMatcher', |
113 | 114 | ));
|
114 | 115 | }
|
115 | 116 |
|
@@ -369,6 +370,8 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
|
369 | 370 | // Exception listener
|
370 | 371 | $exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $configuredEntryPoint ?: $defaultEntryPoint, $firewall['stateless']));
|
371 | 372 |
|
| 373 | + $container->setAlias(new Alias('security.user_checker.'.$id, false), $firewall['user_checker']); |
| 374 | + |
372 | 375 | return array($matcher, $listeners, $exceptionListener);
|
373 | 376 | }
|
374 | 377 |
|
@@ -577,6 +580,7 @@ private function createSwitchUserListener($container, $id, $config, $defaultProv
|
577 | 580 | $switchUserListenerId = 'security.authentication.switchuser_listener.'.$id;
|
578 | 581 | $listener = $container->setDefinition($switchUserListenerId, new DefinitionDecorator('security.authentication.switchuser_listener'));
|
579 | 582 | $listener->replaceArgument(1, new Reference($userProvider));
|
| 583 | + $listener->replaceArgument(2, new Reference('security.user_checker.'.$id)); |
580 | 584 | $listener->replaceArgument(3, $id);
|
581 | 585 | $listener->replaceArgument(6, $config['parameter']);
|
582 | 586 | $listener->replaceArgument(7, $config['role']);
|
|
0 commit comments