public static Client buildClient(final BaseOktaApiProperties properties) {
        val clientBuilder = Clients.builder()
            .setOrgUrl(properties.getOrganizationUrl())
            .setConnectionTimeout(properties.getConnectionTimeout());

        FunctionUtils.doIfNotNull(properties.getApiToken(), token -> clientBuilder.setClientCredentials(new TokenClientCredentials(token)));
        FunctionUtils.doIfNotNull(properties.getPrivateKey().getLocation(), path -> {
            try (val in = path.getInputStream()) {
                val resource = IOUtils.toString(in, StandardCharsets.UTF_8);
                clientBuilder
                    .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY)
                    .setPrivateKey(resource)
                    .setClientId(properties.getClientId())
                    .setScopes(CollectionUtils.wrapHashSet(properties.getScopes()));
            }
        });

        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 client.

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