protected void ensureLogoutRequestIsSignedIfNecessary(final SamlRegisteredService registeredService,
                                                          final MessageContext messageContext) throws SAMLException {
        var ensureSignature = false;
        if (registeredService.getSignLogoutRequest().isUndefined()) {
            val logout = configurationContext.getCasProperties().getAuthn().getSamlIdp().getLogout();
            ensureSignature = logout.isForceSignedLogoutRequests();
        } else {
            ensureSignature = registeredService.getSignLogoutRequest().isTrue();
        }

        if (ensureSignature && !SAMLBindingSupport.isMessageSigned(messageContext)) {
            throw new SAMLException("Logout request is not signed but should be for service %s"
                .formatted(registeredService.getServiceId()));
        }
    }
This is {@link AbstractSamlSLOProfileHandlerController}.

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