Interface AuthenticationClientBuilder

All Known Implementing Classes:
DefaultAuthenticationClientBuilder

public interface AuthenticationClientBuilder
A Builder design pattern used to construct AuthenticationClient instances.

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

Usage

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

 AuthenticationClient client = AuthenticationClients.builder().build();
 

This will:

  • Automatically attempt to find your organization URL value 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_ORGURL. If this values is present, they override any previously discovered value.
  2. A yaml file that exists at the file path ~/.okta/okta.yml or root of the classpath /okta.yml. If this file exists and any values are present, the values override any previously discovered value.
  3. The system properties okta.client.orgUrl. If this value is present, it will override any previously discovered values.

Explicit API Key Configuration

The above default configuration searching heuristics may not be suitable to your needs. In that case, you will likely need to explicitly configure the builder. For example:

 AuthenticationClient client = AuthenticationClients.builder()
   .setOrgUrl("https://example.okta.com")
   .build();
 
Since:
0.1.0