# 401 (Unauthorized) loop for kibana

**URL:** https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [September 22, 2021, 2:11pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881 "2021-09-22T14:11:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)
#### Post date: [September 22, 2021, 2:11pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881/1 "2021-09-22T14:11:17Z")

</div>

I'll start with i dont know if this is an issue with kibana, browser or my UI but someone might have a suggestion.

So i check if kibana is up by hitting `https://kibana-instance:5601/api/status` which returns either 200 if the user is already authenticated or 401 if they are not. If it gets 200 or 401 i return true and attempt to do something if it gets no response(an error) i return false and do something else.

The issue seems to be if you hit that endpoint and get 401 in chrome and firefox (not tested in safari) it will just loop indefinitely. Not sure if its a setting in kibana which i'm not sure it is or if its a know issue.

Any suggestions?

---

<div class="post-metadata">

### Author: ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)
#### Post date: [September 22, 2021, 2:16pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881/2 "2021-09-22T14:16:53Z")

</div>

Have you tried a curl command locally and then from your machine, eliminating the UI or Browser as a first troubleshooting step?

Also given the scheme is https, is the issue with certificates? Are the appropriate certificates setup for SSL or can you revert to http for further troubleshooting / testing ?

---

<div class="post-metadata">

### Author: ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)
#### Post date: [September 22, 2021, 2:36pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881/3 "2021-09-22T14:36:52Z")

</div>

Hi, Yes I get a 401 as expected with curl locally passing no certificate, certs are setup on my kibana/elastic instances with pki enabled and setup. I believe it's due to the fact im not passing a cert from the browser when hitting that endpoint but as i get 401 and no loop with a curl passing no cert locally im making the assumption its the browser/kibana causing this.

---

<div class="post-metadata">

### Author: ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)
#### Post date: [September 22, 2021, 2:51pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881/4 "2021-09-22T14:51:48Z")

</div>

Might be easier to troubleshoot via postman to examine the http response and headers, if you are using curl from the command line and not getting a similar issue, then it is more the browser and not kibana, i would assume.

You can use curl to troubleshoot the handshake

```auto
curl -iv https://kibana-instance:5601/api/status

```

---

<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: [October 20, 2021, 2:52pm UTC](https://discuss.elastic.co/t/401-unauthorized-loop-for-kibana/284881/5 "2021-10-20T14:52:33Z")

</div>

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