@Override
    public Optional<ClientCredential> extract(final BaseClient client, final RequestContext requestContext) {
        LOGGER.debug("Fetching credentials from delegated client [{}]", client);
        val credentials = getCredentialsFromDelegatedClient(requestContext, client);
        if (credentials.isPresent()) {
            val clientCredentialResult = buildClientCredential(client, requestContext, credentials.get());
            clientCredentialResult.ifPresent(clientCredential -> WebUtils.putCredential(requestContext, clientCredential));
            return clientCredentialResult;
        }
        return Optional.empty();
    }
This is {@link DefaultDelegatedAuthenticationCredentialExtractor}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/authentication/principal/DefaultDelegatedAuthenticationCredentialExtractor.java