@Override
    protected Event doExecuteInternal(final RequestContext requestContext) throws Throwable {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val clientCredential = WebUtils.getCredential(requestContext, ClientCredential.class);

        if (clientCredential != null && clientCredential.getCredentials() instanceof final SAML2Credentials saml2Credentials) {
            val message = saml2Credentials.getContext().getMessageContext().getMessage();
            if (message instanceof final LogoutRequest logoutRequest && isDirectLogoutRequest(request)) {
                val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
                removeSsoSessionsForSessionIndexes(request, response, logoutRequest);
            }
            if (message instanceof final LogoutResponse logoutResponse) {
                val logoutRequestTicketId = TransientSessionTicketFactory.normalizeTicketId(logoutResponse.getInResponseTo());
                try {
                    val logoutRequestTicket = ticketRegistry.getTicket(logoutRequestTicketId, TransientSessionTicket.class);
                    if (logoutRequestTicket != null && !logoutRequestTicket.isExpired()) {
                        val delegatedAuthLogoutRequest = logoutRequestTicket.getProperty(DelegatedAuthenticationClientLogoutRequest.class.getName(),
                            DelegatedAuthenticationClientLogoutRequest.class);
                        DelegationWebflowUtils.putDelegatedAuthenticationLogoutRequest(requestContext, delegatedAuthLogoutRequest);
                    }
                } catch (final InvalidTicketException e) {
                    LOGGER.info("Delegated authentication logout request ticket [{}] is not found", logoutRequestTicketId);
                    LOGGER.debug(e.getMessage(), e);
                } finally {
                    ticketRegistry.deleteTicket(logoutRequestTicketId);
                    DelegationWebflowUtils.putDelegatedAuthenticationLogoutRequestTicket(requestContext, null);
                }
            }
        }
        
        return success();
    }
This is {@link DelegatedSaml2ClientLogoutAction}.
<p>
The action takes into account the currently used PAC4J client which is stored
in the user profile. If the client is found, its logout action is executed.
<p>
Assumption: The PAC4J user profile should be in the user session during
logout, accessible with PAC4J Profile Manager. The Logout web flow should
make sure the user profile is present.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-pac4j-saml/src/main/java/org/apereo/cas/web/flow/actions/logout/DelegatedSaml2ClientLogoutAction.java