-
Notifications
You must be signed in to change notification settings - Fork 23
Creating a Client
Brian Demers edited this page Apr 17, 2018
·
1 revision
The easiest way to get started is to create a config file ~/.okta/okta.yaml
that contains your organization URL:
okta:
client:
orgUrl: https://dev-123456.oktapreview.com
Now that you have define the two require fields, you can create a client with a single line of code:
AuthenticationClient client = AuthenticationClients.builder().build();
Or you can configure these attributes programmatically as well:
AuthenticationClient client = ClieAuthenticationClientsts.builder()
.setOrgUrl("https://dev-123456.oktapreview.com)
.build();
Now that you have a client, start using it:
client.authenticate(...);
Configuration values are discovered in a hierarchical manor (where each layer can overwrite the previous)
classpath:com/okta/sdk/config/okta.yaml
classpath:okta.yaml
$HOME/.okta/okta.yaml
- Environment Variables (with dot notation converted to uppercase + underscores)
- JVM System Properties
- Programmatically i.e.
Clients.builder()
okta:
client:
orgUrl: <string>
connectionTimeout: <int> # of seconds
proxy:
port: <int>
host: <string>
username: <string>
password: <string>
okta.client.orgUrl: <string>
okta.client.connectionTimeout: <int> # of seconds
okta.client.proxy.port: <int>
okta.client.proxy.host: <string>
okta.client.proxy.username: <string>
okta.client.proxy.password: <string>
OKTA_CLIENT_ORGURL: <string>
OKTA_CLIENT_CONNECTIONTIMEOUT: <int> # of seconds
OKTA_CLIENT_PROXY_PORT: <int>
OKTA_CLIENT_PROXY_HOST: <string>
OKTA_CLIENT_PROXY_USERNAME: <string>
OKTA_CLIENT_PROXY_PASSWORD: <string>