@Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
        val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(requestContext);
        val context = new JEEContext(request, response);

        var clientName = DelegationWebflowUtils.getDelegatedAuthenticationClientName(requestContext);
        if (clientName == null) {
            clientName = requestContext.getRequestParameters().get(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE);
            if (StringUtils.isNotBlank(clientName)) {
                identityProviders.findClient(clientName, context)
                    .filter(SAML2Client.class::isInstance)
                    .map(SAML2Client.class::cast)
                    .ifPresent(client -> FunctionUtils.doAndHandle(__ -> {
                        client.init();

                        LOGGER.debug("Located client from relay-state [{}]", client);
                        val callContext = new CallContext(context, sessionStore);
                        client.getCredentialsExtractor().extract(callContext).ifPresent(logoutCredentials -> {
                            val result = client.getLogoutProcessor().processLogout(callContext, logoutCredentials);
                            JEEHttpActionAdapter.INSTANCE.adapt(result, context);
                        });
                    }));
            }
        } else {
            val logoutRedirect = WebUtils.getLogoutRedirectUrl(requestContext, String.class);
            val delegatedClientLogoutRequest = DelegationWebflowUtils.getDelegatedAuthenticationLogoutRequest(requestContext,
                DelegatedAuthenticationClientLogoutRequest.class);
            identityProviders.findClient(clientName, context)
                .filter(SAML2Client.class::isInstance)
                .map(SAML2Client.class::cast)
                .ifPresent(client -> {
                    client.init();
                    Optional.ofNullable(delegatedClientLogoutRequest)
                        .filter(__ -> StringUtils.isNotBlank(logoutRedirect))
                        .filter(__ -> StringUtils.isNotBlank(delegatedClientLogoutRequest.getLocation()))
                        .ifPresent(Unchecked.consumer(__ -> {
                            try {
                                val urlBuilder = new URIBuilder(delegatedClientLogoutRequest.getLocation());
                                val samlRequestParam = Optional.ofNullable(urlBuilder.getFirstQueryParam(SamlProtocolConstants.PARAMETER_SAML_REQUEST));
                                samlRequestParam.ifPresent(Unchecked.consumer(samlRequest -> {
                                    val logoutRequest = SamlUtils.convertToSamlObject(openSamlConfigBean, samlRequest.getValue(), LogoutRequest.class);
                                    val service = serviceFactory.createService(logoutRequest.getIssuer().getValue());
                                    service.setTenant(ClientInfoHolder.getClientInfo().getTenant());

                                    val logoutRequestTicketId = TransientSessionTicketFactory.normalizeTicketId(logoutRequest.getID());
                                    val transientFactory = (TransientSessionTicketFactory) ticketFactory.get(TransientSessionTicket.class);
                                    val transientSessionTicket = transientFactory.create(logoutRequestTicketId,
                                        service,
                                        Map.of(DelegatedAuthenticationClientLogoutRequest.class.getName(), delegatedClientLogoutRequest)
                                    );
                                    val storedTicket = ticketRegistry.addTicket(transientSessionTicket);
                                    DelegationWebflowUtils.putDelegatedAuthenticationLogoutRequestTicket(requestContext, storedTicket);
                                }));
                            } finally {
                                LOGGER.debug("Captured post logout url: [{}]", logoutRedirect);
                                WebUtils.putLogoutRedirectUrl(requestContext, null);
                            }
                        }));
                });
        }
        return null;
    }
This is {@link DelegatedSaml2ClientFinishLogoutAction}.
<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/DelegatedSaml2ClientFinishLogoutAction.java