options['failure_path_parameter'])) { $this->options['failure_path'] = $failureUrl; } if (null === $this->options['failure_path']) { $this->options['failure_path'] = $this->options['login_path']; } if ($this->options['failure_forward']) { $this->logger->debug('Authentication failure, forward triggered.', ['failure_path' => $this->options['failure_path']]); $this->logError($request); $subRequest = $this->httpUtils->createRequest($request, $this->options['failure_path']); $subRequest->attributes->set(Security::AUTHENTICATION_ERROR, $exception); return $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } $this->logger->debug('Authentication failure, redirect triggered.', ['failure_path' => $this->options['failure_path']]); $this->logError($request); $request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception); return $this->httpUtils->createRedirectResponse($request, $this->options['failure_path']); } /** * Log error information about fialure * * @param Request $request */ private function logError(Request $request) { $this->logger->error('Authentication failure for user "'.$request->request->get('_username').'", from IP "'.$request->getClientIp().'", with UA: "'.$request->server->get('HTTP_USER_AGENT').'".'); } }