# 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:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanhaiit90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vanhaiit90/32/119189_2.png) [@vanhaiit90](https://discuss.elastic.co/u/vanhaiit90)\
**Post date:** [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/1 "2023-05-16T04:07:48Z")

</div>

I getting case errror when I configure Fleetserver with run file script ./elastic-agents install. . And now show detail log error

> "message":"Fleet Server - Error - info fail [401 Unauthorized] {"error":{"root\_cause":[{"type":"security\_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional\_unsuccessful\_credentials":"oauth2 token: invalid token","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security\_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional\_unsuccessful\_credentials":"oauth2 token: invalid token","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}","ecs.version":"1.6.0"}

 ![ảnh](https://us1.discourse-cdn.com/elastic/original/3X/2/8/2841f0ca08362080f1f32fbcd61ddc26238a41ae.png)

---

<div class="post-metadata">

**Author:** ![Citsale1](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@Citsale1](https://discuss.elastic.co/u/Citsale1)\
**Post date:** [May 16, 2023, 1:10pm UTC](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518/3 "2023-05-16T13:10:37Z")

</div>

Also interested in this question, please advice.

---

<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.

---

<div class="post-metadata">

**Author:** ![vanhaiit90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vanhaiit90/32/119189_2.png) [@vanhaiit90](https://discuss.elastic.co/u/vanhaiit90)\
**Post date:** [May 19, 2023, 1:26am UTC](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518/5 "2023-05-19T01:26:48Z")

</div>

Thank Mr Yang\_Wang. I have tried create token and cert CA again. The resutlt is successfully

---

<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:** [June 16, 2023, 1:27am UTC](https://discuss.elastic.co/t/unable-to-authenticate-with-provided-credentials-and-anonymous-access-is-not-allowed-for-this-request/333518/6 "2023-06-16T01:27:21Z")

</div>

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