Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09bed16

Browse filesBrowse files
committed
Only load old manager if new system is disabled
1 parent ddf430f commit 09bed16
Copy full SHA for 09bed16

File tree

4 files changed

+40
-25
lines changed
Filter options

4 files changed

+40
-25
lines changed

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ public function load(array $configs, ContainerBuilder $container)
107107
$loader->load('security_listeners.xml');
108108
$loader->load('security_rememberme.xml');
109109

110+
if ($this->authenticatorManagerEnabled = $config['enable_authenticator_manager']) {
111+
$loader->load('security_authenticator.xml');
112+
} else {
113+
$loader->load('security_legacy.xml');
114+
}
115+
110116
if (class_exists(AbstractExtension::class)) {
111117
$loader->load('templating_twig.xml');
112118
}
@@ -141,10 +147,6 @@ public function load(array $configs, ContainerBuilder $container)
141147
$container->setParameter('security.access.always_authenticate_before_granting', $config['always_authenticate_before_granting']);
142148
$container->setParameter('security.authentication.hide_user_not_found', $config['hide_user_not_found']);
143149

144-
if ($this->authenticatorManagerEnabled = $config['enable_authenticator_manager']) {
145-
$loader->load('authenticators.xml');
146-
}
147-
148150
$this->createFirewalls($config, $container);
149151
$this->createAuthorization($config, $container);
150152
$this->createRoleHierarchy($config, $container);

‎src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml
-18Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,6 @@
4545
</service>
4646

4747
<!-- Authentication related services -->
48-
<service id="security.authentication.manager.provider" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager">
49-
<argument /> <!-- providers -->
50-
<argument>%security.authentication.manager.erase_credentials%</argument>
51-
<call method="setEventDispatcher">
52-
<argument type="service" id="event_dispatcher" />
53-
</call>
54-
</service>
55-
<service id="security.authentication.manager.authenticator" class="Symfony\Component\Security\Http\Authentication\AuthenticatorManager">
56-
<argument /> <!-- authenticators -->
57-
<argument type="service" id="event_dispatcher" />
58-
<argument>%security.authentication.manager.erase_credentials%</argument>
59-
<call method="setEventDispatcher">
60-
<argument type="service" id="event_dispatcher" />
61-
</call>
62-
</service>
63-
<service id="security.authentication.manager" alias="security.authentication.manager.provider"/>
64-
<service id="Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface" alias="security.authentication.manager" />
65-
6648
<service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" />
6749

6850
<service id="security.authentication.session_strategy" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy">

‎src/Symfony/Bundle/SecurityBundle/Resources/config/authenticators.xml renamed to ‎src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.xml
+14-3Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
55

66
<services>
7+
<!-- Manager -->
8+
9+
<service id="security.authentication.manager.authenticator" class="Symfony\Component\Security\Http\Authentication\AuthenticatorManager">
10+
<argument type="abstract">authenticators</argument>
11+
<argument type="service" id="event_dispatcher" />
12+
<argument>%security.authentication.manager.erase_credentials%</argument>
13+
<call method="setEventDispatcher">
14+
<argument type="service" id="event_dispatcher" />
15+
</call>
16+
</service>
17+
<service id="Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface" alias="security.authentication.manager" />
18+
719
<service id="security.authenticator_handler"
820
class="Symfony\Component\Security\Http\Authentication\AuthenticatorHandler"
921
>
@@ -38,12 +50,12 @@
3850
<argument type="service" id="security.encoder_factory" />
3951
</service>
4052

41-
<service id="Symfony\Component\Security\Http\EventListener\PasswordMigratingListener">
53+
<service id="security.listener.password_migrating" class="Symfony\Component\Security\Http\EventListener\PasswordMigratingListener">
4254
<tag name="kernel.event_subscriber" />
4355
<argument type="service" id="security.encoder_factory" />
4456
</service>
4557

46-
<service id="Symfony\Component\Security\Http\EventListener\UserCheckerListener">
58+
<service id="security.listener.user_checker" class="Symfony\Component\Security\Http\EventListener\UserCheckerListener">
4759
<tag name="kernel.event_subscriber" />
4860
<argument type="service" id="Symfony\Component\Security\Core\User\UserCheckerInterface" />
4961
</service>
@@ -53,7 +65,6 @@
5365
abstract="true">
5466
<tag name="monolog.logger" channel="security" />
5567
<argument type="abstract">remember me services</argument>
56-
<argument type="abstract">provider key</argument>
5768
<argument type="service" id="logger" on-invalid="null" />
5869
</service>
5970

+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<defaults public="false" />
9+
10+
<!-- Authentication related services -->
11+
<service id="security.authentication.manager" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager">
12+
<argument /> <!-- providers -->
13+
<argument>%security.authentication.manager.erase_credentials%</argument>
14+
<call method="setEventDispatcher">
15+
<argument type="service" id="event_dispatcher" />
16+
</call>
17+
</service>
18+
<service id="Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface" alias="security.authentication.manager" />
19+
</services>
20+
</container>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.