Okta API and service app


I am trying to create a service app in Okta to test a server side java application to call Okta Users API to read user profile. In this case, should I use client ID/secret method or public/private key?

In what scenarios the Client Credentials “Client authentication” ‘client secret’ method vs ‘Public key / Private key’ method is used?

And should I use Okta java SDK to call the Okta Users API?

Thanks in advance.

Okta Users API will only be available to your with OAuth2 access_token obtained through a service app with private_key_jwt authentication method.

It’s a matter of your preference if you want to include Okta SDK or build your HTTP API calls with low level HTTPClient library. For Okta it does not matter how the request is prepared. I’d suggest to go with the SDK, as it’s more convenient. If the size of the binary is your concern then you may choose going with manual (HTTPClient) request preparation

Thanks for your response. Could you please clarify when the client secret method is used through service app?

Hey @anu !

The authorization method is dependent on your Okta org setup. If you use an Okta Developer Edition org, use the JWKS method.

You can read more about it on Selecting the Best Authorization for your API Integrations.

Hope this clarifies things. Happy coding!