Tinkerforge / esp32-firmware

Firmwares for ESP32 Brick and ESP32 Ethernet Brick (including firmwares for WARP/WARP2 Charger, WARP Energy Manager)
https://www.tinkerforge.com/en/doc/Hardware/Bricks/ESP32_Ethernet_Brick.html
22 stars 20 forks source link

Safari: Password needs to be typed in again after each reload of the page #342

Open tillsteinbach opened 2 months ago

tillsteinbach commented 2 months ago

On Safari (both Mac OS and iOS) I need to type in my password after every reload of a page of the web interface. On safari for iOS I also need to type in the credentials two times. After getting through the login I can browse through the web interface until I press the "reload" button again, or the page is reloaded by the browser. At the same time using chrome on Mac OS is working very fine. On my iPhone this bug is pretty annoying. Is there any information I can help with to fix this?

Best, Till

rtrbt commented 1 month ago

Sorry, investigating this took a bit. This is a (12 years old!) bug in WebKit (Safari's browser engine): https://bugs.webkit.org/show_bug.cgi?id=80362: WebKit does not use cached credentials if a WebSocket handshake gets a 401 response. For "normal" HTTP requests this works, but for the WebSocket handshake the browser immediately asks for credentials without checking the cache.

On macOS there is a work-around: If you press cancel when Safari asks for credentials the second time (or after reloading the page or restarting Safari). Safari will retry the request with the cached credentials. Unfortunately this does not work on iOS. I'm not sure if there is anything we can do to fix this. Maybe when we have implemented #76, we could switch to HTTP Basic Auth (we use Digest Auth at the moment to not send passwords via plain HTTP) but it looks like Safari has problems with that as well.

tillsteinbach commented 1 month ago

Hmmm, bad news! Actually my usecase would be specifically iOS to control the Wallbox when standing outside. Maybe I have to try out another browser on iOS.

tillsteinbach commented 1 month ago

Leider basiert immer alles in iOS auf der Safari-Engine. Mein work-around ist jetzt erstmal den Login abzuschalten. Schade...

alexander-zimmermann commented 1 month ago

@tillsteinbach You can move the esp behind a reverse proxy like Treafik (+ Authelia) and implement Basic Auth + MFA there