# By passing the login page in the embedded Iframe

**URL:** <https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453>\
**Category:** Kibana\
**Created:** [July 24, 2018, 11:32pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453 "2018-07-24T23:32:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RajiReddy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@RajiReddy](https://discuss.elastic.co/u/RajiReddy)\
**Post date:** [July 24, 2018, 11:32pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453/1 "2018-07-24T23:32:05Z")

</div>

I am trying to embed an iframe in my web application. I don't want to show login screen to my user So I tried to make an ajax call using below code.

$(document).ready(function(){

```
        $.ajax({
            type: "PUT",
            url: "https://nlxesdev01.corp.cvscaremark.com:5601/api/security/v1/login",
            contentType: 'application/x-www-form-urlencoded',
            dateType: 'jsonp',
            xhrFields: { withCredentials: true },
            username: "xxxx",
            date: '{}',
            password: "xxxxx",
            crossDomain: true,
            headers: {"Access-Control-Allow-Origin": "*"},
            success: function (data) {
                alert("Hi");
            }
        });
    });

```

But I am getting below issue. Can you please help me with this?

 ![loginbypassissue](https://us1.discourse-cdn.com/elastic/original/3X/8/0/8058b90450ff7112526ebdad6d7f9a4bc5e7993f.PNG)

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [July 24, 2018, 11:38pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453/2 "2018-07-24T23:38:10Z")

</div>

Hi @RajiReddy, please see these posts:

> [@Auto-authenticating to iframe-embedded Kibana dashboard](https://discuss.elastic.co/t/auto-authenticating-to-iframe-embedded-kibana-dashboard/46091/4):
>
> You can pass the Authorization header as Joe suggests using an nginx proxy. Here is the relevant section of my nginx.conf: server { listen 4443 ssl; # the default was port 443 server\_name tim-virtual-machine.local; ssl\_certificate /home/tim/domain.crt; ssl\_certificate\_key /home/tim/domain.key; ssl\_session\_cache shared:SSL:1m; ssl\_session\_timeout 5m; ssl\_ciphers HIGH:!aNULL:!MD5; ssl\_prefer\_server\_ciphers on; location / { …

> [@Authenticating to iframe-embedded Kibana dashboard](https://discuss.elastic.co/t/authenticating-to-iframe-embedded-kibana-dashboard/71129):
>
> Hi, We have shield protected kibana dashboard embedded as iframe in our UI. We need to be able to pass authentication headers to the dashboard so that the reports can display without the user having to put credentials again. How can we pass the auth headers to kibana from UI?

---

<div class="post-metadata">

**Author:** ![RajiReddy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@RajiReddy](https://discuss.elastic.co/u/RajiReddy)\
**Post date:** [July 24, 2018, 11:55pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453/3 "2018-07-24T23:55:02Z")

</div>

I saw these posts and made an Ajax call as shown above but still couldn't figure out the issue. Is there any sample code with you guys?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [July 26, 2018, 11:53pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453/4 "2018-07-26T23:53:41Z")

</div>

Unfortunately I'm not aware of any sample code.

---

<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:** [August 23, 2018, 11:53pm UTC](https://discuss.elastic.co/t/by-passing-the-login-page-in-the-embedded-iframe/141453/5 "2018-08-23T23:53:41Z")

</div>

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