Getting java.net.ConnectException: Connection timed out: connect while calling microsoft azure outh token url

Capil Verma 6 Reputation points
2022-07-22T09:33:02.3+00:00

Hi Team ,

I am getting java.net.connection exception while calling https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token.
could you please help what needs to be done in this case. do we have enable any port in our machine ..

error |2|:Connect to login.microsoftonline.com:443 [login.microsoftonline.com/20.190.159.64, login.microsoftonline.com/20.190.159.71, login.microsoftonline.com/20.190.159.23, login.microsoftonline.com/40.126.31.69, login.microsoftonline.com/40.126.31.73, login.microsoftonline.com/20.190.159.2, login.microsoftonline.com/20.190.159.68, login.microsoftonline.com/40.126.31.71] failed: Connection timed out: connect
org.apache.http.conn.HttpHostConnectException: Connect to login.microsoftonline.com:443 [login.microsoftonline.com/20.190.159.64, login.microsoftonline.com/20.190.159.71, login.microsoftonline.com/20.190.159.23, login.microsoftonline.com/40.126.31.69, login.microsoftonline.com/40.126.31.73, login.microsoftonline.com/20.190.159.2, login.microsoftonline.com/20.190.159.68, login.microsoftonline.com/40.126.31.71] failed: Connection timed out: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)

attaching the error what i am getting from server.
please help we are blocked to call the token api.223696-httpconnect-error.txt

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} vote

1 answer

Sort by: Most helpful
  1. SUFYAN AHMED 0 Reputation points
    2023-07-24T21:44:36.3166667+00:00

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.