# Missing authentication credentials when visiting localhost:9200 after running elasticsearch.bat

**URL:** <https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018>\
**Category:** Elasticsearch\
**Created:** [January 12, 2023, 11:24am UTC](https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018 "2023-01-12T11:24:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur\_Medforth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arthur_medforth/32/98900_2.png) [@Arthur\_Medforth](https://discuss.elastic.co/u/Arthur_Medforth)\
**Post date:** [January 12, 2023, 11:24am UTC](https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018/1 "2023-01-12T11:24:22Z")

</div>

{"error":{"root\_cause":[{"type":"security\_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}}],"type":"security\_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}},"status":401}

---

<div class="post-metadata">

**Author:** ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)\
**Post date:** [January 12, 2023, 1:08pm UTC](https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018/2 "2023-01-12T13:08:02Z")

</div>

How do you access ES, using a browser, or curl command?  
If you used a browser, the browser will ask you enter username and password for basic auth

if you use CURL, You need to pass the credentials with your request with -u username:password like this:

```auto
curl -X GET -u elastic:your_pass_here "https://localhost:9200"

```

And, Did you enable xpack security on Elasticsearch cluster, could you share the guide tat you are following and share the ES config also?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 12, 2023, 9:21pm UTC](https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018/3 "2023-01-12T21:21:30Z")

</div>

@Arthur_Medforth please do not just post an error with no other information, it makes it very hard to provide help if you are not providing context on what you are doing.

---

<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 9, 2023, 9:21pm UTC](https://discuss.elastic.co/t/missing-authentication-credentials-when-visiting-localhost-9200-after-running-elasticsearch-bat/323018/4 "2023-02-09T21:21:34Z")

</div>

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