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

        val currentProfile = findCurrentProfile(context);
        val clientResult = findCurrentClient(currentProfile, context);
        if (clientResult.isPresent()) {
            val client = clientResult.get();
            LOGGER.trace("Located client [{}]", client);
            val service = WebUtils.getService(requestContext);
            val targetUrl = Optional.ofNullable(service).map(Service::getId).orElse(null);
            LOGGER.debug("Logout target url based on service [{}] is [{}]", service, targetUrl);

            val callContext = new CallContext(context, sessionStore);
            val actionResult = client.getLogoutAction(callContext, currentProfile, targetUrl);
            actionResult.ifPresent(action -> {
                captureDelegatedAuthenticationLogoutRequest(requestContext, action, targetUrl);
                LOGGER.debug("Adapting logout action [{}] for client [{}]", action, client);
                JEEHttpActionAdapter.INSTANCE.adapt(action, context);
            });
        } else {
            LOGGER.debug("The current client cannot be found; No logout action can execute");
        }
        return null;
    }
This is {@link DelegatedAuthenticationClientLogoutAction}.
<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-webflow/src/main/java/org/apereo/cas/web/flow/actions/logout/DelegatedAuthenticationClientLogoutAction.java