# Embedded Kibana dashboard login page keeps reloading back to the same page

**URL:** <https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028>\
**Category:** Kibana\
**Created:** [December 28, 2021, 9:01am UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028 "2021-12-28T09:01:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [December 28, 2021, 9:01am UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/1 "2021-12-28T09:01:20Z")

</div>

I'm still new to Kibana and when I try to embed my Kibana dashboard by giving it anonymous access, it keeps refreshing itself without me doing anything. Gif below for illustration.  
 ![Animation](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b638d1b2b2b87299e40a809e55fbc3b4dd0f565f.gif)  
This is the code I used in my `kibana.yml` file for anonymous access

```auto
xpack.security.authc.providers:
    basic.basic1:
        order: 0
    anonymous.anonymous1:
        order: 1
        credentials:
            username: "anonymous1"
            password: "changeme"

```

I've also done `auth_provider_hint=anonymous1` in my iFrame code:  
`<iframe src="http://localhost:5601/app/dashboards?auth_provider_hint=anonymous1#/view/f4d17e40-3ae3-11ec-838d-cba5e7ef064e?embed=true&_g=(...)" height="600" width="800"></iframe>`

In my Kibana, I also create a new user called anonymous1 and given him a custom role which basically gives the user full access to Kibana.  
I've also tried logging into anonymous1 through Kibana UI and I am indeed able to utilize Kibana fully as seen from the picture below.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/aef6b1a3785c6b67747b07d40b86045e0f39ff8d.png)  
User created for `anonymous1`:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/0/20a57068b24b3239381db167004564e27e11a75f.png)  
Privileges I gave to `anonymous-role` picture 1:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/b/db99c5ee7551291107b2403887b020d5b3c566e5.png)  
picture 2:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/3/4358463d500fa70ab69e7dd6889f6dc4575d7bba.png)  
Any advice will be greatly appreciated! Thank you for your time!

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [December 31, 2021, 1:46pm UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/2 "2021-12-31T13:46:11Z")

</div>

Which version of the stack you are on please?  
@azasypkin can we please get some help?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [December 31, 2021, 1:58pm UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/3 "2021-12-31T13:58:31Z")

</div>

Hello @bhavyarm thank you for your reply

I am currently using 7.15.0 for both Elasticsearch & kibana

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [December 31, 2021, 2:26pm UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/4 "2021-12-31T14:26:26Z")

</div>

Hi @Arrick ,

The configuration looks correct to me (except that the `anonymous1` user is a way too powerful, please reduce the permissions if/when you expose Kibana to the internet).

Let's try to figure out what's going on here:

- Have you tried setting `xpack.security.sameSiteCookies` to `"None"` as described [here](https://www.elastic.co/guide/en/kibana/current/kibana-authentication.html#embedded-content-authentication)?
- Can you try to open the tab with embedded Kibana in a private window? I just want to make sure you don't have any old cookies (you can also explicitly remove all Kibana-specific cookies with browser dev tools).
- If two previous points don't help, can you please record and share a HAR file so that we can see how these infinite redirects look like exactly? It will also might help if you enable verbose logging for Kibana and share the relevant logs:

```auto
logging:
  loggers:
    - name: plugins.security
      appenders: [console]
      level: debug

```

--  
Oleg

---

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [January 3, 2022, 3:52am UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/5 "2022-01-03T03:52:02Z")

</div>

Hello @azasypkin thank you for your reply!  
My embedded works perfectly now when I started to use a new browser (FireFox) instead.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/c/1c4f0b22501199ce5dd58aa1fa0c9b8440288859.jpeg)

I assume I did have a cookies issue with google chrome.  
I did try to use `xpack.security.sameSiteCookies: "None"` in my kibana.yml file but I received an error when trying to enter the website. But that should not be an issue since I know its a cookies error now.  
For `anonymous1` I will reduce its power as I just wanted to make sure I have full access when logging in.  
Thank you for the help and advice! Really appreciate it!

---

<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:** [January 31, 2022, 3:52am UTC](https://discuss.elastic.co/t/embedded-kibana-dashboard-login-page-keeps-reloading-back-to-the-same-page/293028/6 "2022-01-31T03:52:33Z")

</div>

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