I'm trying to embed grafana inside my angularjs app. I can do it easily with a simple iframe but my app uses jwt for authentication and I can't find a way to set a header for an iframe. I've confirmed that it works perfectly fine when I turn authentication off with the basic iframe but I need it enabled to use in production.
I've also tried using $http
to get the grafana html(this way I can set my jwt header) but the js doesn't seem to work using this method. I assume it's related to the bootstraping since they bootstrap manually.
//iframe
<iframe id="grafana" layout-fill flex></iframe>
//controller
$http.get('/grafana/dashboard').then(function(response) {
var iframeDocument = document.getElementById('grafana').contentWindow.document
iframeDocument.open('text/html', 'replace')
iframeDocument.write(response.data)
iframeDocument.close()
})
Is there other way I can set a header on an iframe? I also tried just using grafana's html as a template but as I said before their bootstrapping seems to not work within another app.