# Kibana keeps logging users out "An unexpected authentication error..."

**URL:** <https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635>\
**Category:** Kibana\
**Created:** [February 8, 2022, 4:29pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635 "2022-02-08T16:29:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ykara84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ykara84/32/106391_2.png) [@ykara84](https://discuss.elastic.co/u/ykara84)\
**Post date:** [February 8, 2022, 4:29pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/1 "2022-02-08T16:29:41Z")

</div>

Our two Kibana instances have started to unexpectedly log users out very frequently, sometimes just after few seconds after logging in. Other times it seems to be stable and keeps user logged in then bam! logged out again with error _"An unexpected authentication error occurred. Please log in again"_

This only seems to have happened since updating our stack to 7.16.2. Both instances are hosted on Red Hat, one is an elastic cluster the other is not.

Occurs on different client computers and browsers.

Anyone seen this before or any advice on how we can troubleshoot?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e19e1892f675c4a424c2c1f60bd8419fc6b17736.png)

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [March 2, 2022, 3:26pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/2 "2022-03-02T15:26:01Z")

</div>

Hey @ykara84 ,

Sorry for the very delayed reply! Are you still experiencing this issue?

It sounds like a case when configuration of your two Kibana's isn't in sync anymore. Can you check if `kibana.yml`\keystore\env variables are identical for all your Kibana instances?

Best,  
Oleg

---

<div class="post-metadata">

**Author:** ![ykara84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ykara84/32/106391_2.png) [@ykara84](https://discuss.elastic.co/u/ykara84)\
**Post date:** [March 3, 2022, 4:29pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/3 "2022-03-03T16:29:32Z")

</div>

@azasypkin yes still having the issue, we will check that and report back. thanks

---

<div class="post-metadata">

**Author:** ![ykara84](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ykara84/32/106391_2.png) [@ykara84](https://discuss.elastic.co/u/ykara84)\
**Post date:** [March 3, 2022, 4:42pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/4 "2022-03-03T16:42:30Z")

</div>

Hi @azasypkin they are some for both instances

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [March 3, 2022, 5:02pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/5 "2022-03-03T17:02:00Z")

</div>

Okay, did you follow [these recommendations](https://www.elastic.co/guide/en/kibana/current/production.html#load-balancing-kibana) for Kibana load balancing?

These encryption keys should be set explicitly and be the same across all instances:

```auto
xpack.security.encryptionKey // decrypting session information
xpack.reporting.encryptionKey // decrypting reports
xpack.encryptedSavedObjects.encryptionKey // decrypting saved objects

```

---

<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:** [March 31, 2022, 5:02pm UTC](https://discuss.elastic.co/t/kibana-keeps-logging-users-out-an-unexpected-authentication-error/296635/6 "2022-03-31T17:02:05Z")

</div>

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