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

Forgot password not working post update sdk to 24.0.0

Open cchaubey opened this issue 5 months ago • 1 comments

Describe the bug?

UserCredApi - ForgotPasswordResponse forgotPassword(String userId, Boolean sendEmail) fails with 400 "Bad request. Accept and/or Content-Type headers likely do not match supported values." after updating the sdk to 24.0.0. As a temporary fix we are adding header Map.of("Content-Type", "application/json") to make this work.

What is expected to happen?

UserCredApi - ForgotPasswordResponse forgotPassword(String userId, Boolean sendEmail) should work.

What is the actual behavior?

UserCredApi - ForgotPasswordResponse forgotPassword(String userId, Boolean sendEmail) fails with 400 "Bad request. Accept and/or Content-Type headers likely do not match supported values." after updating the sdk to 24.0.0, for now we are adding header Map.of("Content-Type", "application/json") to make this work.

Reproduction Steps?

Execute ForgotPasswordResponse forgotPassword(String userId, Boolean sendEmail) method for a newly created user.

Image

Additional Information?

No response

Java Version

17

SDK Version

24.0.0

OS version

No response

cchaubey avatar Aug 05 '25 14:08 cchaubey

Additional Details:

In class com.okta.sdk.resource.api.UserCredApi, the method public ForgotPasswordResponse forgotPassword(String userId, Boolean sendEmail, Map<String, String> additionalHeaders) throws ApiException, the content-type header is set as text/xml (final String[] localVarContentTypes = { "text/xml", };) which is causing the issue.

Image

abhishek-workday avatar Aug 05 '25 14:08 abhishek-workday