protected Collection<ConfigurableDelegatedClient> buildOAuth20IdentityProviders(final CasConfigurationProperties casProperties) {
        val pac4jProperties = casProperties.getAuthn().getPac4j();
        return pac4jProperties
            .getOauth2()
            .stream()
            .filter(oauth -> oauth.isEnabled()
                && StringUtils.isNotBlank(oauth.getId())
                && StringUtils.isNotBlank(oauth.getSecret()))
            .map(oauth -> {
                val client = new GenericOAuth20Client();
                client.setProfileId(StringUtils.defaultIfBlank(oauth.getPrincipalIdAttribute(), pac4jProperties.getCore().getPrincipalIdAttribute()));
                client.setKey(SpringExpressionLanguageValueResolver.getInstance().resolve(oauth.getId()));
                client.setSecret(SpringExpressionLanguageValueResolver.getInstance().resolve(oauth.getSecret()));
                client.setProfileAttrs(oauth.getProfileAttrs());
                client.setProfileUrl(oauth.getProfileUrl());
                client.setProfileVerb(Verb.valueOf(oauth.getProfileVerb().toUpperCase(Locale.ENGLISH)));
                client.setTokenUrl(oauth.getTokenUrl());
                client.setAuthUrl(oauth.getAuthUrl());
                client.setScope(oauth.getScope());
                client.setCustomParams(oauth.getCustomParams());
                client.setWithState(oauth.isWithState());
                FunctionUtils.doIfNotBlank(oauth.getClientAuthenticationMethod(), client::setClientAuthenticationMethod);
                client.getConfiguration().setResponseType(oauth.getResponseType());

                LOGGER.debug("Created client [{}]", client);
                return new ConfigurableDelegatedClient(client, oauth);
            })
            .collect(Collectors.toList());
    }
This is {@link DelegatedClientOidcBuilder}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-pac4j-oidc/src/main/java/org/apereo/cas/pac4j/web/DelegatedClientOidcBuilder.java