# OIDC SocketTimeoutException

**URL:** <https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 8, 2021, 9:50pm UTC](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685 "2021-11-08T21:50:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibrooes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ibrooes/32/96716_2.png) [@ibrooes](https://discuss.elastic.co/u/ibrooes)\
**Post date:** [November 8, 2021, 9:50pm UTC](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685/1 "2021-11-08T21:50:37Z")

</div>

Getting this error message in logs. Does anyone have an idea what could this be indicating?  
I have checked my token endpoint through postman, and it works.

[instance-0000000001] Authentication to realm oidc1 failed - Failed to authenticate user with OpenID Connect (Caused by ElasticsearchSecurityException[Failed to exchange code for Id Token using the Token Endpoint.]; nested: SocketTimeoutException[5,000 milliseconds timeout on connection http-outgoing-0 [ACTIVE]]

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 8, 2021, 11:00pm UTC](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685/2 "2021-11-08T23:00:55Z")

</div>

Please keep your questions to a single thread, it makes it easier for people to help you 🙂 [OIDC token\_type issue, Token type must be Bearer](https://discuss.elastic.co/t/oidc-token-type-issue-token-type-must-be-bearer/288655)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 8, 2021, 11:00pm UTC](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685/3 "2021-11-08T23:00:58Z")

</div>



---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [November 8, 2021, 11:18pm UTC](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685/4 "2021-11-08T23:18:54Z")

</div>

Is the error intermittent? If so, you are likely hitting a known [issue](https://github.com/elastic/elasticsearch/issues/75515)

You can get around this by adjusting `net.ipv4.tcp_retries2` as suggested in this [comment](https://github.com/elastic/elasticsearch/issues/75515#issuecomment-883258339).
