cassidyjames / butler

Home Assistant companion app for Linux
https://cassidyjames.com
GNU General Public License v3.0
55 stars 1 forks source link

2FA not supported in WebKitGTK (shows "Start Over" button at login) #37

Open latenightdef opened 1 month ago

latenightdef commented 1 month ago

I'm trying to connect Butler to my Home Assistant instance that has 2FA enabled. I copied my username and password from my password manager, clicked login and keep getting this page: image

This issue seems to be also reproducible in GNOME Web, while the login works fine on Firefox & Chromium

cassidyjames commented 1 month ago

If it's reproducible in GNOME Web, unfortunately there's nothing I can do in this app to resolve it. :( What I can do is display a banner noting that 2FA is currently unsupported and link to this issue, though!

@latenightdef could you share the URL of this "Start Over" page, in case it has a unique path that I can match to show the banner on? You can find it by navigating to that page in Butler, and then running this in a terminal:

cat ~/.var/app/com.cassidyjames.butler/config/glib-2.0/settings/keyfile | grep current-url

The URL will be listed as the value for the current-url key.

latenightdef commented 1 month ago

The value of the current-url key is

https://home.techtransthai.org/auth/authorize?response_type=code&redirect_uri=https%3A%2F%2Fhome.techtransthai.org%2F%3Fauth_callback%3D1&client_id=https%3A%2F%2Fhome.techtransthai.org%2F&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly9ob21lLnRlY2h0cmFuc3RoYWkub3JnIiwiY2xpZW50SWQiOiJodHRwczovL2hvbWUudGVjaHRyYW5zdGhhaS5vcmcvIn0%3D

Also on GNOME Web's address bar:

https://home.techtransthai.org/auth/authorize?response_type=code&redirect_uri=https%3A%2F%2Fhome.techtransthai.org%2F%3Fauth_callback%3D1&client_id=https%3A%2F%2Fhome.techtransthai.org%2F&state=eyJoYXNzVXJsIjoiaHR0cHM6Ly9ob21lLnRlY2h0cmFuc3RoYWkub3JnIiwiY2xpZW50SWQiOiJodHRwczovL2hvbWUudGVjaHRyYW5zdGhhaS5vcmcvIn0%3D

They seemed to be exact same URLs

cassidyjames commented 1 month ago

@latenightdef thanks! I'll play with it some more, but it seems like the /auth/authorize path might be enough to match on to show a headerbar. That shouldn't be too hard.