# Kibana in Custom App

**URL:** https://discuss.elastic.co/t/kibana-in-custom-app/154450
**Category:** Kibana
**Created:** [October 29, 2018, 1:41pm UTC](https://discuss.elastic.co/t/kibana-in-custom-app/154450 "2018-10-29T13:41:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![adwaitjoshi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adwaitjoshi/32/35098_2.png) [@adwaitjoshi](https://discuss.elastic.co/u/adwaitjoshi)
#### Post date: [October 29, 2018, 1:41pm UTC](https://discuss.elastic.co/t/kibana-in-custom-app/154450/1 "2018-10-29T13:41:00Z")

</div>

I am trying to embed Kibana (with XPACK) enabled in a custom app.

Logically it would work as follows

The user is authenticated in the custom app and then a call is made to Kibana (with authentication headers) based on his role. The list of Visuals and Dashboards is displayed and the user is able to see them.

I am having a hard time with the auth enabled. If I call the dashboard directly, I am able to authenticate but then it needs several libraries to render the UI and it fails.

If I do a iFrame, setting the Auth on it is very insecure. Whats the best way to accomplish this?

---

<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: [October 29, 2018, 1:57pm UTC](https://discuss.elastic.co/t/kibana-in-custom-app/154450/2 "2018-10-29T13:57:20Z")

</div>

@Larry_Gregory/ @Brandon_Kobel so far we have been doing it with iFrames. I am not sure if I understand why this is insecure? Can we please get some help?

Thanks,  
Bhavya

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [October 29, 2018, 2:00pm UTC](https://discuss.elastic.co/t/kibana-in-custom-app/154450/3 "2018-10-29T14:00:24Z")

</div>

The best way to accomplish this is via reverse-proxy. Instead of having an iframe with hard-coded credentials, the iframe can point to a reverse proxy that you control. The proxy then has logic to add the auth headers, as required.

Here's an example setup for nginx that you can use as a starting point: [Auto-authenticating to iframe-embedded Kibana dashboard](https://discuss.elastic.co/t/auto-authenticating-to-iframe-embedded-kibana-dashboard/46091/4?u=larry_gregory)

---

<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: [November 26, 2018, 2:00pm UTC](https://discuss.elastic.co/t/kibana-in-custom-app/154450/4 "2018-11-26T14:00:26Z")

</div>

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