Skip to content

Creating a Client

Brian Demers edited this page Jun 7, 2017 · 9 revisions

The easiest way to get started is to create a config file ~/.okta/okta.yaml that contains your organization URL and API token:

okta:
  client:
    token: <your-super-secret-api-token>
    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:

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

Or you can configure these attributes programmatically as well:

Client client = Clients.builder()
        .setClientCredentials(new TokenClientCredentials("<your-super-secret-api-token>"))
        .setOrgUrl("https://dev-123456.oktapreview.com)
        .build();

Now that you have a client, start using it:

client.listUsers()

Clone this wiki locally