protected void validateLogoutRequest(final LogoutRequest logoutRequest, final SAML2MessageContext context,
                                         final SignatureTrustEngine engine) {

        logger.trace("Validating logout request:\n{}", Configuration.serializeSamlObject(logoutRequest));
        validateSignatureIfItExists(logoutRequest.getSignature(), context, engine);

        // don't check because of CAS v5
        //validateIssueInstant(logoutRequest.getIssueInstant());

        validateIssuerIfItExists(logoutRequest.getIssuer(), context);

        var nameId = logoutRequest.getNameID();
        val encryptedID = logoutRequest.getEncryptedID();
        if (encryptedID != null) {
            nameId = decryptEncryptedId(encryptedID, decrypter);
        }

        val samlNameId = SAML2AuthenticationCredentials.SAMLNameID.from(nameId);
        String sessionIndex = null;
        val sessionIndexes = logoutRequest.getSessionIndexes();
        if (sessionIndexes != null && !sessionIndexes.isEmpty()) {
            val sessionIndexObject = sessionIndexes.get(0);
            if (sessionIndexObject != null) {
                sessionIndex = sessionIndexObject.getValue();
            }
        }

        val sloKey = computeSloKey(sessionIndex, samlNameId);
        if (sloKey != null && logoutHandler != null) {
            logoutHandler.destroySession(context.getCallContext(), sloKey);
        }
    }
Validates the SAML logout request.

@param logoutRequest the logout request
@param context       the context
@param engine        the signature engine
pac4j-saml/src/main/java/org/pac4j/saml/logout/impl/SAML2LogoutValidator.java