# Kibana error: security\_exception: \[security\_exception\] Reason: unable to authenticate with provided credentials and anonymous access is not allowed for this request

**URL:** <https://discuss.elastic.co/t/kibana-error-security-exception-security-exception-reason-unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/344243>\
**Category:** Elasticsearch\
**Created:** [October 2, 2023, 4:01pm UTC](https://discuss.elastic.co/t/kibana-error-security-exception-security-exception-reason-unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/344243 "2023-10-02T16:01:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PodarcisMuralis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/podarcismuralis/32/122606_2.png) [@PodarcisMuralis](https://discuss.elastic.co/u/PodarcisMuralis)\
**Post date:** [October 2, 2023, 4:01pm UTC](https://discuss.elastic.co/t/kibana-error-security-exception-security-exception-reason-unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/344243/1 "2023-10-02T16:01:03Z")

</div>

Hi.

I upgraded the Kibana from 7.17 to 8.5.3 and got some corrupt indices.  
then I used these instructions and deleted .kibana and . monitoring indices.  
[Resolve Migration Failures](https://www.elastic.co/guide/en/kibana/master/resolve-migrations-failures.html#_corrupt_saved_objects)

But I also deleted .security\_7. This resetted all passwords. I had to recreate all the passwords in elasticsearch.

Now I have many problems in Kibana Logs steaming like heartbeats.

```auto
security_exception: [security_exception] Reason: unable to authenticate with provided credentials and anonymous access is not allowed for this request

```

```auto
Re-authentication cannot be handled.

```

Here is my kibana.yml

```auto
server.port: 5601
server.host: "myIP"
server.publicBaseUrl: "myURLWithAnS"
server.ssl.enabled: true
server.ssl.certificate: myCert.crt
server.ssl.key: myKey.key
elasticsearch.hosts: ["myThreeHosts"]
elasticsearch.username: "user"
elasticsearch.ssl.certificate: myCert.crt
elasticsearch.ssl.key: myKey.key
elasticsearch.ssl.verificationMode: none
pid.file: /../pids/kibana.pi
monitoring.kibana.collection.enabled: false
monitoring.ui.ccs.enabled: false
xpack.screenshotting.browser.chromium.disableSandbox: true
xpack.security.encryptionKey: "myKey"
xpack.encryptedSavedObjects.encryptionKey: "myEncKey"
xpack.reporting.encryptionKey: "my2EncKey"
xpack.reporting.roles.enabled: false

```

Can you please help me with this issue?  
Thanks

---

<div class="post-metadata">

**Author:** ![PodarcisMuralis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/podarcismuralis/32/122606_2.png) [@PodarcisMuralis](https://discuss.elastic.co/u/PodarcisMuralis)\
**Post date:** [October 5, 2023, 3:26pm UTC](https://discuss.elastic.co/t/kibana-error-security-exception-security-exception-reason-unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/344243/2 "2023-10-05T15:26:00Z")

</div>

I solved this.  
After resetting passwords in elasticsearch, I restarted Logstash, Kibana, Elasticsearch.  
But I still got this error.  
Then I generated the new keys like here: [kibana encryption keys](https://www.elastic.co/guide/en/kibana/8.5/kibana-encryption-keys.html)

Command:  
`./bin/kibana-encryprion-keys generate --force`

I copied newly generated keys to

```auto
xpack.security.encryptionKey: "myKey"
xpack.encryptedSavedObjects.encryptionKey: "myEncKey"
xpack.reporting.encryptionKey: "my2EncKey"

```

Then I solve the Encryption API Key Problem here: [encryption API](https://discuss.elastic.co/t/kibana-errors-after-changing-encryptionkey-failed-to-decrypt-apikey-attribute-unsupported-state-or-unable-to-authenticate-data/344492)

---

<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:** [November 2, 2023, 3:26pm UTC](https://discuss.elastic.co/t/kibana-error-security-exception-security-exception-reason-unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/344243/3 "2023-11-02T15:26:01Z")

</div>

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