An error occurred while attempting to decode the Jwt: Couldn't retrieve remote JWK set: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://dev-92408568.okta.com/oauth2/default/v1/keys"

Hello okta team, I have an error when I want to call my api, I have a token that is generated by the react frontend.

for my backend I use the sample you put on your documentation :point_right: samples-java-spring/resource-server at master · okta/samples-java-spring · GitHub.

and when I call my api I have an error which is created on its backend which is the following
:point_right:
Couldn’t retrieve remote JWK set: org.springframework.web.client.ResourceAccessException: I/O error on GET request for “https://dev-92408568.okta.com/oauth2/default/v1/keys”: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How to solve this problem? Or is there a way to fix this error?

Hmm… I don’t see anything wrong with the /keys endpoint you are using. It sounds like your server isn’t able to reach the /keys endpoint. Is your Spring Server able to hit Okta at all?

Hello, I solved this problem, I added the certificate on my java keystore, it is fine now

1 Like

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