protected String getDelegatedClientId(final WebContext webContext, final Client client) {
        var clientId = webContext.getRequestParameter(PARAMETER_CLIENT_ID).map(String::valueOf).orElse(StringUtils.EMPTY);
        clientId = getDelegatedClientIdFromSessionStore(webContext, client, clientId, CasClient.class, CAS_CLIENT_ID_SESSION_KEY);

        if (StringUtils.isBlank(clientId) && client != null) {
            val builders = getDelegatedClientSessionManagers(client);
            val iterator = builders.iterator();
            while (StringUtils.isBlank(clientId) && iterator.hasNext()) {
                val builder = iterator.next();
                clientId = builder.retrieveIdentifier(webContext, client);
            }
        }
        LOGGER.debug("Located delegated client identifier [{}]", clientId);
        return clientId;
    }
This is {@link DefaultDelegatedClientAuthenticationWebflowManager}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/flow/DefaultDelegatedClientAuthenticationWebflowManager.java