diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index 16bad6df54..f16adbe8c1 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -44,8 +44,9 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn private $firewallMap; private $firewall; private $hasVarDumper; + private $authenticatorManagerEnabled; - public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null) + public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null, $authenticatorManagerEnabled = false) { $this->tokenStorage = $tokenStorage; $this->roleHierarchy = $roleHierarchy; @@ -54,6 +55,7 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn $this->firewallMap = $firewallMap; $this->firewall = $firewall; $this->hasVarDumper = class_exists(ClassStub::class); + $this->authenticatorManagerEnabled = $authenticatorManagerEnabled; } /** @@ -204,6 +206,8 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn if ($this->firewall) { $this->data['listeners'] = $this->firewall->getWrappedListeners(); } + + $this->data['authenticator_manager_enabled'] = $this->authenticatorManagerEnabled; } /** @@ -389,4 +393,9 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn { return 'security'; } + + public function isAuthenticatorManagerEnabled(): bool + { + return $this->data['authenticator_manager_enabled']; + } } diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index b59ac7b66d..6f48e5313d 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -132,6 +132,8 @@ class SecurityExtension extends Extension implements PrependExtensionInterface $loader->load('collectors.php'); $loader->load('guard.php'); + $container->getDefinition('data_collector.security')->addArgument($this->authenticatorManagerEnabled); + if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) { $loader->load('security_debug.php'); } diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 6b0819513f..9f69abcaf2 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -159,10 +159,12 @@ {{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }} Stateless + {% if collector.authenticatorManagerEnabled == false %}