# Unable to authenticate with provided credentials and anonymous access is not allowed for this request

**URL:** <https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, fleet\
**Created:** [May 16, 2023, 4:07am UTC](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518 "2023-05-16T04:07:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [May 17, 2023, 1:26pm UTC](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518/4 "2023-05-17T13:26:20Z")

</div>

How did you create the Fleet service token? Did you use the CLI? Service token created with the CLI is local to the node where the CLI runs. See doc [here](https://www.elastic.co/guide/en/elasticsearch/reference/master/service-tokens-command.html#_description_9). We recommend using the [CreateServiceAccountToken API](https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-create-service-token.html) to create service tokens which are usable on all nodes within a cluster.

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518)._
