Embed Kibana (v5.2) Visualization in iFrame X-Frame-Options


(Joseph D Carroll Jr) #1

I am trying to embed a Kibana Visualization into an external page using angular. I've looked at a number of different threads and none of them seem to answer what I am looking for:

The angular code I'm using is the following:

<iframe
    class="dashboard-iframe"
    [src]="(visualizationUrl | safe)"
    height="600" width="800"
    >
</iframe>

The visualizationUrl is something like:

// Copied from "Emedded iFrame" under "Shared Saved Visualization" 
visualizationUrl = `https://my-proxy.sitting.in-front-of.elastic-and-kibana.com/_plugin/kibana/app/kibana#/visualize/my-viz-name?embed=true&_g=some-js-stuff`

When I load this into Chrome I get the following in the console:

Refused to display 'https://my-proxy.sitting.in-front-of.elastic-and-kibana.com/_plugin/kibana/app/kibana#/visualize/my-viz-name?embed=true&_g=some-js-stuff' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

How do I change it so that it allows my domain?


(Spencer Alger) #2

A pull request just went into master to make this configurable in Kibana but hasn't been released yet, so the X-Frame-Options header must be getting set by your proxy. You'll have to adjust the options there to allow embedding on your desired domain.


(system) #3

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