Getting access token is throwing 500 intermittently

Hi All,

I am getting intermittent 500 Http response once i try to get the access token after passing the authcode in my java application.

Just for understanding purpose below is the exact flow.

  1. First we enter the username & password in the okta page. After that one more validation of phone number/OTP. on successful validation we receive a “AuthCode” and gets redirected to the URL which is whitelisted.

  2. Based on this “Authcode”, We hit the " https://{orgname}.okta.com/oauth2/default/v1/token " api to get an access token.

  3. On receiving the access token, we hit the " https://{orgname}.okta.com/oauth2/default/v1/userinfo " api to get final user data from okta.

The second steps failed intermittently. I have checked all the parameters for success and fail use case, there is no difference.

Please help. Thanks in advance.

Hi @GSharma1

Are you receiving the 500 error from Okta directly or from an API gateway that you are using? If it’s directly from Okta, do you have a timestamp when the error occurred and the message received in the response?

Hi @dragos

If i understand your question correctly, we are doing a server to server call to Okta API.

We are getting the below error

Timestamp - 2019-12-18 10:12:23 (UTC)

Error - org.springframework.web.client.ResourceAccessException: I/O error on POST request for “https://xxxxxxxxxx.okta.com/oauth2/default/v1/token”: Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:732)

Thanks