okta-sdk-java icon indicating copy to clipboard operation
okta-sdk-java copied to clipboard

Using the SDK with WireMock

Open thecodesmith opened this issue 6 months ago • 0 comments

I am building a microservice that integrates with Okta using the Okta Java SDK to retrieve user and group data. For automated testing I'd like to use WireMock to mock the Okta API endpoints so my application code can be fully exercised, without hitting Okta rate limits as well as easier setup of test data for many different scenarios. However, so far I haven't been able to find a way to configure the Okta SDK to work with my WireMock endpoints due to two issues:

  1. The Okta SDK does not accept an http:// URL and requires https://
  2. I can configure WireMock to run over HTTPS with a custom KeyStore, but have not found how I can configure the Okta SDK to trust the custom KeyStore using a TrustManager/SSLContext

I did find this comment which was promising but it appears ClientBuilder.setRequestExecutorFactory() was removed in SDK v10.0.0. Is there a comparable way to accomplish my needs in the current SDK version?

thecodesmith avatar Jun 26 '25 18:06 thecodesmith