/**
  * 
  * @param AuthenticationFailureEvent $event
  * @throws AuthenticationException
  */
 public function onAuthenticationFailure(AuthenticationFailureEvent $event)
 {
     throw new AuthenticationException($event->getAuthenticationException());
 }
 /**
  * This is called when an interactive authentication attempt fails. This is
  * called by authentication listeners inheriting from
  * AbstractAuthenticationListener.
  *
  * @param AuthenticationFailureEvent $event Event triggering this callback.
  *
  * @return Response
  */
 public function onAuthenticationFailure(AuthenticationFailureEvent $event)
 {
     /** @var \Symfony\Component\Security\Core\Exception\AuthenticationException $exception */
     $exception = $event->getAuthenticationException();
     $this->logger->warning($exception->getMessageKey(), array('data' => $exception->getMessageData()));
 }
 /**
  * @param AuthenticationFailureEvent $event Authentication failure event
  */
 public function onAuthenticationFailure(AuthenticationFailureEvent $event)
 {
     if (is_a($event->getAuthenticationException(), 'Symfony\\Component\\Security\\Core\\Exception\\BadCredentialsException')) {
         drupal_set_message(t('Sorry, unrecognized username or password. <a href="@password">Have you forgotten your password?</a>', array('@password' => url('user/password', array('query' => array('name' => $event->getAuthenticationToken()->getUser()))))), 'error');
     }
 }