Skip to content

Fix web view authentication challenges#1130

Open
timbms wants to merge 5 commits intodevelopfrom
fix/webview-authentication-settings
Open

Fix web view authentication challenges#1130
timbms wants to merge 5 commits intodevelopfrom
fix/webview-authentication-settings

Conversation

@timbms
Copy link
Copy Markdown
Contributor

@timbms timbms commented Apr 7, 2026

Rebased on DigiH:settings.

Summary

  • Adds alwaysSendSameAuthenticationToWebView to HomePreferences — when enabled, server credentials are forwarded to all web view authentication challenges regardless of host
  • Automatically forwards credentials when the challenge host matches a configured server URL or is home.myopenhab.org, with no setting change required
  • Adds a toggle in Connection Settings (visible when not in demo mode) to control the opt-in behaviour
  • Adds a custom Codable decoder to HomePreferences using decodeIfPresent for all fields, ensuring existing users don't lose their preferences when new keys are introduced

Fixes #1034

Test plan

  • Webview pointing to a resource on the same host as the openHAB server loads correctly without enabling the toggle
  • Webview pointing to a resource on a different host (e.g. embedded Grafana on same IP but different path) loads correctly after enabling "Always send credentials to web views"
  • Remote connection through home.myopenhab.org authenticates web views correctly without enabling the toggle
  • Toggling the setting off reverts to default-handling for unmatched hosts
  • Existing user preferences survive an app update (no data loss)

DigiH and others added 2 commits March 31, 2026 21:16
Signed-off-by: DigiH <17110652+DigiH@users.noreply.github.com>
…r user opt-in

Adds alwaysSendSameAuthenticationToWebView to HomePreferences so users can
opt in to sending server credentials to all web view authentication challenges.
Without the flag, credentials are still forwarded automatically when the
challenge host matches a configured server URL or is home.myopenhab.org.

Also adds a custom Codable decoder to HomePreferences using decodeIfPresent
for all fields to ensure backward compatibility when new keys are introduced.

Fixes #1034

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
timbms and others added 3 commits April 6, 2026 21:59
Move the always-send-credentials toggle inside the Group so it renders
within the connection settings section. Remove erroneous await from a
synchronous property access and use existential any Decoder syntax.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webviews using authentication aren't working anymore

2 participants