diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 97ede2281f..dbecca12e9 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -107,6 +107,12 @@ class SecurityExtension extends Extension implements PrependExtensionInterface $loader->load('security_listeners.xml'); $loader->load('security_rememberme.xml'); + if ($this->authenticatorManagerEnabled = $config['enable_authenticator_manager']) { + $loader->load('security_authenticator.xml'); + } else { + $loader->load('security_legacy.xml'); + } + if (class_exists(AbstractExtension::class)) { $loader->load('templating_twig.xml'); } @@ -141,10 +147,6 @@ class SecurityExtension extends Extension implements PrependExtensionInterface $container->setParameter('security.access.always_authenticate_before_granting', $config['always_authenticate_before_granting']); $container->setParameter('security.authentication.hide_user_not_found', $config['hide_user_not_found']); - if ($this->authenticatorManagerEnabled = $config['enable_authenticator_manager']) { - $loader->load('authenticators.xml'); - } - $this->createFirewalls($config, $container); $this->createAuthorization($config, $container); $this->createRoleHierarchy($config, $container); diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml index b04662aaf7..26da337312 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml @@ -45,24 +45,6 @@ - - - %security.authentication.manager.erase_credentials% - - - - - - - - %security.authentication.manager.erase_credentials% - - - - - - - diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/authenticators.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.xml similarity index 82% rename from src/Symfony/Bundle/SecurityBundle/Resources/config/authenticators.xml rename to src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.xml index 9ec5f17e0a..4cbc440625 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/authenticators.xml +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.xml @@ -4,6 +4,18 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd"> + + + + authenticators + + %security.authentication.manager.erase_credentials% + + + + + + @@ -38,12 +50,12 @@ - + - + @@ -53,7 +65,6 @@ abstract="true"> remember me services - provider key diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_legacy.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_legacy.xml new file mode 100644 index 0000000000..85d672a078 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_legacy.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + %security.authentication.manager.erase_credentials% + + + + + + +