public static AuthenticationClient buildAuthenticationClient(final OktaAuthenticationProperties properties) {
        val clientBuilder = AuthenticationClients.builder()
            .setOrgUrl(properties.getOrganizationUrl())
            .setConnectionTimeout(properties.getConnectionTimeout());
        
        if (StringUtils.isNotBlank(properties.getProxyHost()) && properties.getProxyPort() > 0) {
            if (StringUtils.isNotBlank(properties.getProxyUsername()) && StringUtils.isNotBlank(properties.getProxyPassword())) {
                clientBuilder.setProxy(new Proxy(properties.getProxyHost(), properties.getProxyPort(),
                    properties.getProxyUsername(), properties.getProxyPassword()));
            } else {
                clientBuilder.setProxy(new Proxy(properties.getProxyHost(), properties.getProxyPort()));
            }
        }
        return clientBuilder.build();
    }
Build authentication client.

@param properties the properties
@return the authentication client
support/cas-server-support-okta-authentication/src/main/java/org/apereo/cas/okta/OktaConfigurationFactory.java