public function prepareLogoutResponse(LogoutRequest $request)
    {
        $response = $this->createLogoutResponse();

        $idp = $this->getMetadata()->getFirstIdpSsoDescriptor();

        $location = $idp->getFirstSingleLogoutService()->getResponseLocation()
            ? $idp->getFirstSingleLogoutService()->getResponseLocation()
            : $idp->getFirstSingleLogoutService()->getLocation();

        $response->setDestination($location);
        $response->setRelayState($request->getRelayState());

        $this->signMessage($response);

        return $response;
    }