protected Optional<? extends Client> findCurrentClient(final UserProfile currentProfile, final WebContext webContext) {
        return currentProfile == null
            ? Optional.empty()
            : identityProviders.findClient(currentProfile.getClientName(), webContext);
    }
This is {@link DelegatedSaml2ClientTerminateSessionAction}.
<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/DelegatedSaml2ClientTerminateSessionAction.java