protected void handleLogoutRequest(final WSFederationRequest fedRequest, final HttpServletRequest request,
                                       final HttpServletResponse response) throws Exception {

        val logoutUrl = FunctionUtils.doIf(StringUtils.isNotBlank(fedRequest.wreply()),
                () -> {
                    val service = createService(fedRequest);
                    val registeredService = getWsFederationRegisteredService(service);
                    LOGGER.debug("Invoking logout operation for request [{}], redirecting next to [{}] matched against [{}]",
                        fedRequest, fedRequest.wreply(), registeredService);
                    val logoutParam = getConfigContext().getCasProperties().getLogout().getRedirectParameter().getFirst();
                    return getConfigContext().getCasProperties().getServer().getLogoutUrl()
                        .concat("?").concat(logoutParam).concat("=").concat(service.getId());
                },
                () -> getConfigContext().getCasProperties().getServer().getLogoutUrl())
            .get();
        response.sendRedirect(logoutUrl);
    }
Handle federation request.

@param response the response
@param request  the request
@throws Exception the exception
support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestController.java