diff --git a/UPGRADE-7.4.md b/UPGRADE-7.4.md index d3f628bc16b54..145ecde788957 100644 --- a/UPGRADE-7.4.md +++ b/UPGRADE-7.4.md @@ -34,3 +34,14 @@ Security * Deprecate callable firewall listeners, extend `AbstractListener` or implement `FirewallListenerInterface` instead * Deprecate `AbstractListener::__invoke` * Deprecate `LazyFirewallContext::__invoke()` + * Add argument `$requestDecision` to `AuthenticatorInterface::supports()`; + it should be used to report the reason a request isn't supported. E.g: + + ```php + public function supports(Request $request, ?RequestDecision $requestDecision = null): ?bool + { + $requestDecision?->addReason('This authenticator does not support any request.'); + + return false; + } + ``` 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 f2706858e45cf..5ffa1a1b82a43 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -423,7 +423,9 @@
This authenticator did not support the request.
+ {% for reason in (authenticator.requestDecisionReasons ?? []) is empty ? ['This authenticator did not support the request.'] : authenticator.requestDecisionReasons %} +{{ reason }}
+ {% endfor %}