Auto login mit Firefox 115.5.0

CMK version: 2.2.0p17
OS version:RHEL 8.9

Hallo zusammen

wir haben seit längerem ein Raspi mit AlmaLinux am laufen. Auf diesem läuft ein Firefox im Kiosk mode mit welchem wir bis anhin ohne Probleme ein dashboard mit Autologin aufmachen konnten.
Dazu nutzen wir einen Automation user.
Seit dem letzten Update auf p17 funktioniert das automatische login nicht mehr.

Gestartet wird der Firefox (upgrade auf 115.5.0) mit

/home/[AUTOMATION USER]/.config/autostart/firefox.desktop

In diesem File befindet sich eine Section Exec in welcher ich folgendes eingetragen habe:

Exec=firefox -kiosk -private-window https://[FQDN HOSTNAME]/main/check_mk/login.py?&_origtarget=dashboard.py?name=public_01&_username=[AUTOMATION USERNAME]&_secret=[AUTOMATION USERSECRET]&_login=1

Leider funktioniert das nicht mehr und ich habe keine Ahnung warum.
Kann mir jemand hier eventuell helfen?

Herzlichen Dank

Roberto

Das liegt an dieser Änderung: Automationuser login must not open full session

Kurz gesagt: Automation Accounts dürfen sich nicht an der Weboberfläche anmelden, sondern nur die API verwenden.

1 Like

Hallo Roberto

Herzliuchen Dank für den Hinweis.
Leider funktioiert das ganze aber noch immer nicht.

image

Auf einem Google Chrom geht das Hervorragen aber auf dem Firefox leider nicht.

https://[FQDN HOSTNAME]/main/check_mk/login.py?&_origtarget=dashboard.py?name=public_01&_username=kiosk&_secret=.kiosk.&_login=1

Ach so, der URL-Parameter heißt dann _password und nicht mehr _secret.

1 Like

Herzlichen Dank :slight_smile:

Aber leider scheint der _login=1 auch nicht mehr zu funktionieren.
Wo finde ich im Übrigens den Hinweis mit dem _password ?

Hier: Benutzer, Zuständigkeiten, Berechtigungen - Die Konfiguration für Benutzer und Autorisierung

Ich sehe gerade, dass das hier auch noch relevant sein dürfte: Manual enablement of login using HTTP GET to avoid unintentional leakage of user credentials in Apache's access logs

2 Likes

Ich habe die Lösung mit Hilfe von
Manual enablement of login using HTTP GET to avoid unintentional leakage of user credentials in Apache's access logs
gefunden.

Herzlichen Dank für diesen Hinweis Robert.

Einfach unter Setup > Global Settings > Enable login via GET requests einschalten. Dann funktioniert es auch auf den neusten Versionen von Firefox.

mit 2.3.0 wird die Option deprecated die Credentials im GET Parameter mitzugeben und in 2.5.0 komplett entfernt.
Da wir auch einige Firefox Kiosks auf Raspi Basis zum Anzeigen von Dashboards auf TVs verwenden würde mich interessieren ob jemand eine Idee hat wie ein Autologin zukünftig funktionieren kann, am besten ohne irgendwelche Firefox Plugins die einen Auth Header anhängen.

siehe:

1 Like

While I like Kiosks, I dislike the idea of sessions that last forever. So I would suggest this workaround:

First: Set the expiry (both idle and absolute) reasonably high.

Second: When a login should be needed, connect via SSH to the Kiosk device (here tunneling port 5900):

ssh -L 5900:localhost:5900 root@192.0.2.1

Then in the session start x11vnc mirroring the display:

x11vnc -localhost -auth guess

Then you can use any VNC client (I prefer remmina) to get the desktop (on localhost:0), log in, change settings… It should also be noted that for many sophisticated dashboards old RPi 1 and 2 are getting too slow. In this case run a xpra session on a faster machine in the background and only use the RPi to display the xpra session. Another advantage here is that you can pickup the xpra session from any machine to configure something or login.

Ping me if you need further details, I will write a small tutorial on xpra then.

@mschlenker, this is less than a bad workaround.
Kiosks do not work with manual login.
Grafana dashboards can be shown in Kiosk modes without any issues.

1 Like

To clarify: Login not to the desktop session, but login to a web site in a browser. Checkmk is not the only application that does not provide endless sessions. And from time to time you need to configure things like the tab cycle extension. The big advantage of x11vnc here is to mirror the physical output – usually much more convenient than connecting a physical keyboard and mouse.

If you use a system like Dashkiosk’s documentation — Dashkiosk 2.7.11 documentation you get no chance to manually login to a website that should be displayed.

Please see the initial post. Using an RPi and autostarting a browser in a user session seems to be a very common approach to display Checkmk dashboards:

hey, would be nice to get an short tutorial from u:) we arent sure if this is really a solution for us but to understand it better we would love to hear from u:)

Hi

Put your browser into autostart (/etc/.config/autostart/filename.desktop)
In that file on section Exec add firefox -kiosk -private-window https://[FQDN HOSTNAME]/main/check_mk/login.py?&_origtarget=dashboard.py?name=public_01&_username=[AUTOMATION USERNAME]&_secret=[AUTOMATION USERSECRET]&_login=1 and that’s it.

There is nothing more to explain.
Yes before you do that :slight_smile: of course, you need to have a user to log in. This username and password (unfortunately) need to go into the string above.

many thanks for the answer,
but wasn’t it noted that this solution will be removed?
and we had this solution running, but it doesn’t work anymore (yes we can reactivate it until checkmk 2.5, but we would like to have a long-term solution) - that’s why we asked @mschlenker how his solution works:P