@Override
    protected Principal finalizeAuthenticationPrincipal(final Principal initialPrincipal, final BaseClient client,
                                                        final ClientCredential credential, final Service service) throws Throwable {
        val processors = applicationContext.getBeansOfType(DelegatedAuthenticationPreProcessor.class)
            .values()
            .stream()
            .filter(BeanSupplier::isNotProxy)
            .collect(Collectors.toList());
        AnnotationAwareOrderComparator.sortIfNecessary(processors);
        var processingPrincipal = initialPrincipal;
        for (val processor : processors) {
            processingPrincipal = processor.process(processingPrincipal, client, credential, service);
        }
        return processingPrincipal;
    }
Authentication handler which gets the credentials and then the user profile
in a delegated authentication process from an external identity provider.

@author Jerome Leleu
@since 3.5.0
support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/handler/support/DelegatedClientAuthenticationHandler.java