# Oidc 5000milliseconds timeout. oidc realm oidc1 failed to authenticate

**URL:** <https://discuss.elastic.co/t/oidc-5000milliseconds-timeout-oidc-realm-oidc1-failed-to-authenticate/301659>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [April 5, 2022, 6:33pm UTC](https://discuss.elastic.co/t/oidc-5000milliseconds-timeout-oidc-realm-oidc1-failed-to-authenticate/301659 "2022-04-05T18:33:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_Muhammad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ali_muhammad/32/43530_2.png) [@Ali\_Muhammad](https://discuss.elastic.co/u/Ali_Muhammad)\
**Post date:** [April 5, 2022, 6:33pm UTC](https://discuss.elastic.co/t/oidc-5000milliseconds-timeout-oidc-realm-oidc1-failed-to-authenticate/301659/1 "2022-04-05T18:33:52Z")

</div>

Hello community.  
I have been stuck with following message for a while now.

```auto
[2022-04-05T18:20:23,391][WARN][o.e.x.s.a.AuthenticationService] [vesa-brokerage-elk-multizone-es-node-2] 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-1 [ACTIVE]];)

```

This hosting is being done on a kubernetes environment where it runs fine on one cluster(IBMCloud) but fails on the other cluster hosted on Azure. I initially thought that maybe it's because of the TTL time for the A record and the azure's NS but that's not the case.  
I have tried adding what yang\_wang [suggested](https://discuss.elastic.co/t/oidc-sockettimeoutexception/288685/2) but that didn't do anything. The logs still showed 5000ms timeout.  
Any help will be great. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 3, 2022, 6:34pm UTC](https://discuss.elastic.co/t/oidc-5000milliseconds-timeout-oidc-realm-oidc1-failed-to-authenticate/301659/2 "2022-05-03T18:34:41Z")

</div>

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