public function onExceptionSendChallenge(ExceptionEvent
$event) { if (isset($this->challengeProvider
) &&
$event->
isMainRequest()) { $request =
$event->
getRequest();
$exception =
$event->
getThrowable();
if ($exception instanceof AccessDeniedHttpException && !
$this->authenticationProvider->
applies($request) && (!
isset($this->filter
) ||
$this->filter->
appliesToRoutedRequest($request, FALSE
))) { $challenge_exception =
$this->challengeProvider->
challengeException($request,
$exception);
if ($challenge_exception) { $event->
setThrowable($challenge_exception);
} } } } /**
* Detect disallowed authentication methods on access denied exceptions.
*
* @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event
* The event.
*/