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?
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