Looking for the Okta API to work with Access Token

Hi,

I am trying to invoke the okta API by using the SDK where I am trying to get the client connection by using the OIDC API Services app but getting error nested exception is com.okta.sdk.impl.oauth2.OAuth2HttpException: invalid_client - The client_assertion signature is invalid.

Client client = Clients.builder()
.setOrgUrl(“https://{okta domain}”) // e.g. https://dev-123456.okta.com
.setAuthorizationMode(AuthorizationMode.PRIVATE_KEY)
.setClientId("{API Services App client ID}")
.setKid("{Private Key KID}") // key id (optional)
.setScopes(new HashSet<>(Arrays.asList(“okta.users.read”, “okta.groups.read”)))
.setPrivateKey("{Private key pem file path}").build();

Thanks,
Rajesh

Hi,

I am able to resolve it. The private key format is wrong which is causing the issue. Connection started working after using the private key in PEM format.

Thanks,
Rajesh

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.