I am using Grafana dashboards to display critical data on my website. Therefore, I embed the Grafana public dashboard link within an HTML iframe on my website. However, I don’t want customers to see this public link in any way. I haven’t been able to find a solution for this in either Grafana or the HTML side. Even if I change the URL using Flask, the link still appears in the iframe’s #document section. Is there a way to achieve this using a Grafana service account key or any other method?
i am also playing with this currently.
I am fronting my iframe link with nginx, so i am trying to get nginx to check for a logged in session cookie before it redirects to the page, so even if customers can view the iframe src and see the link, if they try access it without a valid cookie that gets set by my apllication, it will send them to the login screen.
trying being the operative word here
got it working…
my config is as follows:
grafana, wordpress and nginx proxy manager (NPM) running as containers in docker, with a shared docker network, so they can all see eachother. i am only exposing the npm port 80 and 443
in npm i have a proxy host that checks for a wordpress login cookie, if there is a cookie present it redirects to the grafana page, no cookie, it redirects to the wordpress login screen.
in wordpress, i use a plugin “LoginWP” that sets the login page to the grafaan page, so once you are logged in, it will direct you to the grafana page.
in npm i also setup a custom location site/grafana, that also checks for the login cookie, no cookie, back to the login page, cookie present, go to grafana.
i had to edit my grafana.ini to set the server from subpath to /grafana and i changed the url to the url of my npm url.
it may seem clunky, but this lets me manage users and access to various other pages, sites etc. using wordpress roles and role permissions as my access control mechanism instead of grafana