# Error: \[config validation of \[elasticsearch\].serviceAccountToken\]: serviceAccountToken cannot be specified when "username" is also set

**URL:** https://discuss.elastic.co/t/error-config-validation-of-elasticsearch-serviceaccounttoken-serviceaccounttoken-cannot-be-specified-when-username-is-also-set/321020
**Category:** Kibana
**Created:** [December 12, 2022, 11:04am UTC](https://discuss.elastic.co/t/error-config-validation-of-elasticsearch-serviceaccounttoken-serviceaccounttoken-cannot-be-specified-when-username-is-also-set/321020 "2022-12-12T11:04:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![iLucas.Bechlte.exe](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@iLucas.Bechlte.exe](https://discuss.elastic.co/u/iLucas.Bechlte.exe)
#### Post date: [December 12, 2022, 11:04am UTC](https://discuss.elastic.co/t/error-config-validation-of-elasticsearch-serviceaccounttoken-serviceaccounttoken-cannot-be-specified-when-username-is-also-set/321020/1 "2022-12-12T11:04:39Z")

</div>

Hello,

when I try to follow [this](https://www.elastic.co/de/blog/getting-started-with-elasticsearch-security) instruction to secure my Elastic Stack, I will get this error:

```auto
Error: [config validation of [elasticsearch].serviceAccountToken]: serviceAccountToken cannot be specified when "username" is also set.

```

What am I doing wrong? In kibana.yml the Service account Token is disabled:

```auto
elasticsearch.username: "kibana_system"
elasticsearch.password: *A password*

# elasticsearch.serviceAccountToken: "my_token"

```

---

<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: [January 9, 2023, 8:35am UTC](https://discuss.elastic.co/t/error-config-validation-of-elasticsearch-serviceaccounttoken-serviceaccounttoken-cannot-be-specified-when-username-is-also-set/321020/2 "2023-01-09T08:35:09Z")

</div>



---

<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: [February 6, 2023, 8:35am UTC](https://discuss.elastic.co/t/error-config-validation-of-elasticsearch-serviceaccounttoken-serviceaccounttoken-cannot-be-specified-when-username-is-also-set/321020/3 "2023-02-06T08:35:25Z")

</div>

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