@Override
    public void restore(final RequestContext requestContext) throws Exception {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
        var registeredService = WebUtils.getRegisteredService(request);
        val cookieValue = delegatedSaml2IdPSloRequestCookieGenerator.retrieveCookieValue(request);

        if (registeredService == null && StringUtils.isNotBlank(cookieValue)) {
            val decodedCookieValue = EncodingUtils.decodeBase64(cookieValue);
            val cookieValues = MAPPER.readValue(decodedCookieValue, Map.class);
            val samlLogoutRequest = (String) cookieValues.get(SamlProtocolConstants.PARAMETER_SAML_REQUEST);
            val entityId = (String) cookieValues.get(SamlProtocolConstants.PARAMETER_ENTITY_ID);
            val relayState = (String) cookieValues.get(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE);

            val service = serviceFactory.createService(entityId);
            service.getAttributes().put(SamlProtocolConstants.PARAMETER_ENTITY_ID, entityId);
            service.getAttributes().put(SamlProtocolConstants.PARAMETER_SAML_REQUEST, samlLogoutRequest);
            registeredService = servicesManager.findServiceBy(service);
            RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(registeredService);

            WebUtils.putRegisteredService(request, registeredService);
            WebUtils.putSingleLogoutRequest(request, samlLogoutRequest);

            request.setAttribute(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE, relayState);
            requestContext.getFlowScope().put(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE, relayState);
            delegatedSaml2IdPSloRequestCookieGenerator.removeCookie(response);
        }

    }
This is {@link DelegatedAuthenticationSamlIdPSingleLogoutRequestProcessor}.

@author Misagh Moayyed
@since 7.3.0
support/cas-server-support-pac4j-saml/src/main/java/org/apereo/cas/web/saml2/DelegatedAuthenticationSamlIdPSingleLogoutRequestProcessor.java