# Kibana login loop while use iframe

**URL:** <https://discuss.elastic.co/t/kibana-login-loop-while-use-iframe/296542>\
**Category:** Kibana\
**Created:** [February 8, 2022, 2:43am UTC](https://discuss.elastic.co/t/kibana-login-loop-while-use-iframe/296542 "2022-02-08T02:43:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![petertw6235](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@petertw6235](https://discuss.elastic.co/u/petertw6235)\
**Post date:** [February 8, 2022, 2:43am UTC](https://discuss.elastic.co/t/kibana-login-loop-while-use-iframe/296542/1 "2022-02-08T02:43:58Z")

</div>

Hi,  
I shared my Kibana dashboard with public link(anonymous) and user can visit my dashboard in our website used iframe.  
But the browser will try to login again and again without showing anything.  
I got the following error message both in my chrome dev tool and kibana log.

> {"type":"response","@timestamp":"2022-02-08T09:31:10+08:00","tags":,"pid":17315,"method":"get","statusCode":401,"req":{"url":"/api/licensing/info","method":"get","headers":{"host":"kheslogkibana","connection":"keep-alive","kbn-version":"7.16.2","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43","kbn-system-request":"true","content-type":"application/json","accept":"_/_","referer":"[http://kheslogkibana/login?next=%2Fs%2Fmh12%2Fgoto%2Ffbdae2f8e495130a5e75909f914edec3","accept-encoding":"gzip](http://kheslogkibana/login?next=%2Fs%2Fmh12%2Fgoto%2Ffbdae2f8e495130a5e75909f914edec3%22,%22accept-encoding%22:%22gzip), deflate","accept-language":"en-US,en;q=0.9"},"remoteAddress":"10.19.2.249","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43","referer":"[http://kheslogkibana/login?next=%2Fs%2Fmh12%2Fgoto%2Ffbdae2f8e495130a5e75909f914edec3"},"res":{"statusCode":401,"responseTime":22,"contentLength":66},"message":"GET](http://kheslogkibana/login?next=%2Fs%2Fmh12%2Fgoto%2Ffbdae2f8e495130a5e75909f914edec3%22%7D,%22res%22:%7B%22statusCode%22:401,%22responseTime%22:22,%22contentLength%22:66%7D,%22message%22:%22GET) /api/licensing/info 401 22ms - 66.0B"}

And I also got the same error with this case:

> [@CSP errors when using an Kibana iframe](https://discuss.elastic.co/t/csp-errors-when-using-an-kibana-iframe/246096):
>
> Running into CSP errors when using dashboard \> share \> embed \> iframe. Copied the iframe to a local html file & pasted it there. \<html\> \<body\> \<iframe src="https://kibana.myurl:5601/app/dashboards#/view/fc6ea5f0-e3bf-11ea-84c0-073e1429eecc?embed=true&\_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-15M%2Cto%3Anow))&show-top-menu=true&show-query-input=true&show-time-filter=true" frameBorder="0" height="750" width="1200"\>\</iframe\> \</body\> \</html\> Resulting in…

But they didn't get the 401 error.  
Do I need to set https and SameSite = None to fix this issue?

Kibana Version : 7.16.2  
Ealsticsearch Version: 7.16.2

---

<div class="post-metadata">

**Author:** ![petertw6235](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@petertw6235](https://discuss.elastic.co/u/petertw6235)\
**Post date:** [February 11, 2022, 12:31am UTC](https://discuss.elastic.co/t/kibana-login-loop-while-use-iframe/296542/2 "2022-02-11T00:31:57Z")

</div>

Hi,  
We fixed this issue by setting kibana https and sameSite = None.

```auto
xpack.security.sameSiteCookies: None
xpack.security.secureCookies: true

```

> <https://github.com/elastic/kibana/issues/87929>
>
> \*\*Kibana version:\*\* 7.11.0 latest snapshot
> 
> \*\*Elasticsearch version:\*\* 7.11.0 …latest snapshot
> 
> \*\*Server OS version:\*\* darwin\_x86\_64
> 
> \*\*Browser version:\*\* chrome latest 
> 
> \*\*Browser OS version:\*\* OS X
> 
> \*\*Original install method (e.g. download page, yum, from source, etc.):\*\* from staging
> 
> \*\*Describe the bug:\*\* If user shares a dashboard in an iframe and tries to login Kibana just keeps looping the login window. Same error in incognito window.
> 
> \<img width="1792" alt="Screen Shot 2021-01-11 at 4 18 32 PM" src="https://user-images.githubusercontent.com/7074629/104239905-3d134f00-5429-11eb-96e4-c26c24ab3609.png"\>
> 
> console error:
> \`\`\`
> Uncaught (in promise) Error: Unauthorized
> at \_callee3$ (localhost:5601/37533/bundles/core/core.entry.js:6)
> at l (localhost:5601/37533/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321)
> at Generator.\_invoke (localhost:5601/37533/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321)
> at Generator.forEach.e.\<computed\> \[as next\] (localhost:5601/37533/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321)
> at fetch\_asyncGeneratorStep (localhost:5601/37533/bundles/core/core.entry.js:6)
> at \_next (localhost:5601/37533/bundles/core/core.entry.js:6)
> \`\`\`

---

<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:** [March 11, 2022, 12:32am UTC](https://discuss.elastic.co/t/kibana-login-loop-while-use-iframe/296542/3 "2022-03-11T00:32:19Z")

</div>

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