/**
  * {@inheritdoc}
  */
 public function handle(GetResponseEvent $event)
 {
     if (null === ($rawToken = $this->getTokenFromRequest($event->getRequest()))) {
         return;
     }
     $token = new SharedSecretToken();
     $token->setCredentials($rawToken);
     try {
         $returnValue = $this->authenticationManager->authenticate($token);
         if ($returnValue instanceof TokenInterface) {
             return $this->securityContext->setToken($returnValue);
         }
         if ($returnValue instanceof Response) {
             return $event->setResponse($returnValue);
         }
     } catch (AuthenticationException $e) {
         if (null !== ($p = $e->getPrevious())) {
             $event->setResponse($p->getHttpResponse());
         }
     }
 }