protected LogoutResponse buildSamlLogoutResponse(final SamlRegisteredServiceMetadataAdaptor adaptor,
                                                     final SingleLogoutService sloService,
                                                     final SamlRegisteredService registeredService,
                                                     final LogoutRequest logoutRequest,
                                                     final HttpServletRequest request,
                                                     final HttpServletResponse response) throws Exception {
        val id = '_' + String.valueOf(RandomUtils.nextLong());
        val builder = configurationContext.getLogoutResponseBuilder();
        val status = builder.newStatus(StatusCode.SUCCESS, "Success");
        val issuer = builder.newIssuer(configurationContext.getCasProperties().getAuthn().getSamlIdp().getCore().getEntityId());

        val location = StringUtils.isBlank(sloService.getResponseLocation())
            ? sloService.getLocation()
            : sloService.getResponseLocation();
        LOGGER.trace("Creating logout response for binding [{}] with issuer [{}], location [{}] and service provider [{}]",
            sloService.getBinding(), issuer, location, adaptor.getEntityId());
        val logoutResponse = builder.newLogoutResponse(id, location, issuer, status, logoutRequest.getID());

        if (signSamlLogoutResponseFor(registeredService)) {
            LOGGER.trace("Signing logout request for service provider [{}]", adaptor.getEntityId());
            val logoutResponseSigned = configurationContext.getSamlObjectSigner()
                .encode(logoutResponse, registeredService, adaptor, response,
                    request, sloService.getBinding(), logoutRequest, new MessageContext());
            configurationContext.getOpenSamlConfigBean().logObject(logoutResponseSigned);
            return logoutResponseSigned;
        }
        return logoutResponse;
    }
This is {@link SamlIdPSingleLogoutRedirectionStrategy}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/slo/SamlIdPSingleLogoutRedirectionStrategy.java