Interface ClientBuilder

All Known Implementing Classes:
DefaultClientBuilder

public interface ClientBuilder

The ClientBuilder is used to construct Client instances with Okta credentials, Proxy and Cache configuration. Understanding caching is extremely important when creating a Client instance, so please ensure you read the Caching section below.

Usage:

The simplest usage is to just call the build() method, for example:

 Client client = Clients.builder().build();
 

This will:

  • Automatically attempt to find your API credentials values in a number of default/conventional locations and then use the discovered values. Without any other configuration, the following locations will be each be checked, in order:
  1. The environment variable OKTA_CLIENT_TOKEN. If either of these values are present, they override any previously discovered value.
  2. The system properties okta.client.token. If this value is present, it will override any previously discovered values.

SECURITY NOTICE: While the okta.client.token system property or environment variable OKTA_CLIENT_TOKEN may be used to represent your API Key Secret as mentioned above, this is not recommended: process listings on a machine will expose process arguments (like system properties) or environment variables, thus exposing the secret value to anyone that can read process listings. As always, secret values should never be exposed to anyone other than the person that owns the API Key.

Since:
0.5.0