public function handle(GetResponseEvent $event)
    {
        $apiKey = $this->getApiKeyFromQueryOrHeader($event->getRequest());

        if (false === $apiKey) {
            return;
        }

        try {
            $token = $this->authenticationManager->authenticate(new ApiKeyToken($apiKey));
            $this->tokenStorage->setToken($token);
        } catch (AuthenticationException $failed) {
            $this->tokenStorage->setToken(null);
            $this->doFailureResponse($event);
        }
    }