mocdaniel / dashing-icinga2

Dashing dashboard for Icinga 2 using the REST API
MIT License
205 stars 47 forks source link

Autologin for the two iframes #91

Closed benhartwich closed 4 years ago

benhartwich commented 4 years ago

Hi,

thank you for your work. I´m using the docker version and it works great. Is it somehow possible to set environment variables for an automatic login to the both iframes at the bottom of the dashboard?

dnsmichi commented 4 years ago

Unfortunately no, since the Iframes don't allow to pass credentials. Browsers prevent this from happening., see https://medium.com/@lmakarov/say-goodbye-to-urls-with-embedded-credentials-b051f6c7b6a3 With CORS also in place, this even becomes harder with JS workarounds.

Edit: You can create a standalone web location, e.g. /icingaweb2-dashing with a different autologin option (external, and apache sets REMOTE_USER, based on IP address access).

mtdeguzis commented 4 years ago

We ended up using something like webscraper (PyPi) / Selenium to log into the main page, then snap an image of Dashing. Works well. We just then display that on a tv / httpd webpage.

dnsmichi commented 4 years ago

Thanks for sharing 👍

There is not much other possibilities than to e.g. edit the dashboard and remove these widgets.

mtdeguzis commented 4 years ago

I wanted to note that others may want to look into Puppeteer over Selenium if you want to get fancy with Chrome :) https://developers.google.com/web/tools/puppeteer/get-started