You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The iOS Companion App's onboarding/auth WebView (OnboardingAuthLoginViewControllerImpl in Sources/App/Onboarding/API/OnboardingAuthLoginViewController.swift) is a plain WKWebView() with default configuration. This means:
iOS system Passkey/WebAuthn AutoFill does not reach into the WebView
Third-party credential providers (KeePassium, 1Password, Bitwarden) cannot serve credentials to the auth flow
iCloud Keychain passkeys are not surfaced because the app has no Associated Domain for the user's self-hosted instance
Result: users with WebAuthn-only setups (which is the recommended Authentik posture) can't log in via the App and must fall back to TOTP.
This is the same root cause as the closed issues #3139 ("Companion app login Authentication fails" — closed not planned, Nov 2024) and #3753 ("Pangolin secure key login not working" — closed completed without fix, Jul 2025).
Context — why this matters now
OIDC adoption for HA via the christiaangoossens/hass-oidc-auth HACS integration is growing. The server side just gained mobile-app support (PR christiaangoossens/hass-oidc-auth#317, draft, planned for v1.2.0) — the integration now correctly issues the homeassistant://auth-callback redirect for clients identified as the iOS App. That confirms the server side works against WKWebView's decidePolicyFor-based deep-link interception.
But the auth UI rendering inside WKWebView remains the blocker for WebAuthn / Passkey users, regardless of which OIDC provider sits behind HA.
Proposed solution
Switch OnboardingAuthLoginViewControllerImpl from WKWebView to ASWebAuthenticationSession for the OAuth flow. Apple explicitly recommends ASWebAuthenticationSession for OAuth/OIDC (WWDC 2018 "Introducing Password AutoFill") — it shares the Safari cookie store, surfaces iOS Passkey/Autofill natively, and handles the custom-scheme callback (homeassistant://auth-callback) via its built-in completion handler.
The historical reason for the prior switch to WKWebView (issue #233, 2021) was Apple's HTTP-callback deprecation. That doesn't affect HA's flow today because the callback is always homeassistant:// (custom scheme).
Compatibility concerns and proposed hybrid
Two real limitations of ASWebAuthenticationSession that affect self-hosted setups:
Self-signed certificates: ASWebAuthenticationSession has no URLAuthenticationChallenge delegate. The current WKNavigationDelegate.webView(_:didReceive:completionHandler:) (lines ~94-108) handles self-signed CAs via SecurityExceptions.
Proposed hybrid: route through ASWebAuthenticationSession by default, fall back to the existing WKWebView controller when SecurityExceptions.hasExceptions is truthy or a ClientCertificate is configured. The default path solves WebAuthn for the 80% case (publicly-trusted certs, no mTLS); the fallback preserves the self-hosted edge cases that motivated the original switch.
Promise signature stays Promise<URL>.
Where to patch
based on authDetails.exceptions and authDetails.clientCertificate
Sources/App/Onboarding/API/OnboardingAuthDetails.swift — already provides scheme for callbackURLScheme:
Tests under Tests/App/Onboarding/ — add coverage for both branches
What I can offer
I'm a user, not an iOS developer — I can test on iOS 26 with self-hosted HA + Authentik, file a follow-up issue with logs if needed, but I'm not in a position to submit the PR myself. If a maintainer or community contributor picks this up, I'll happily verify against my setup.
Problem
The iOS Companion App's onboarding/auth WebView (
OnboardingAuthLoginViewControllerImplinSources/App/Onboarding/API/OnboardingAuthLoginViewController.swift) is a plainWKWebView()with default configuration. This means:Result: users with WebAuthn-only setups (which is the recommended Authentik posture) can't log in via the App and must fall back to TOTP.
This is the same root cause as the closed issues #3139 ("Companion app login Authentication fails" — closed not planned, Nov 2024) and #3753 ("Pangolin secure key login not working" — closed completed without fix, Jul 2025).
Context — why this matters now
OIDC adoption for HA via the
christiaangoossens/hass-oidc-authHACS integration is growing. The server side just gained mobile-app support (PR christiaangoossens/hass-oidc-auth#317, draft, planned for v1.2.0) — the integration now correctly issues thehomeassistant://auth-callbackredirect for clients identified as the iOS App. That confirms the server side works againstWKWebView'sdecidePolicyFor-based deep-link interception.But the auth UI rendering inside
WKWebViewremains the blocker for WebAuthn / Passkey users, regardless of which OIDC provider sits behind HA.Proposed solution
Switch
OnboardingAuthLoginViewControllerImplfromWKWebViewtoASWebAuthenticationSessionfor the OAuth flow. Apple explicitly recommendsASWebAuthenticationSessionfor OAuth/OIDC (WWDC 2018 "Introducing Password AutoFill") — it shares the Safari cookie store, surfaces iOS Passkey/Autofill natively, and handles the custom-scheme callback (homeassistant://auth-callback) via its built-in completion handler.The historical reason for the prior switch to
WKWebView(issue #233, 2021) was Apple's HTTP-callback deprecation. That doesn't affect HA's flow today because the callback is alwayshomeassistant://(custom scheme).Compatibility concerns and proposed hybrid
Two real limitations of
ASWebAuthenticationSessionthat affect self-hosted setups:ASWebAuthenticationSessionhas noURLAuthenticationChallengedelegate. The currentWKNavigationDelegate.webView(_:didReceive:completionHandler:)(lines ~94-108) handles self-signed CAs viaSecurityExceptions.WKWebView.Proposed hybrid: route through
ASWebAuthenticationSessionby default, fall back to the existingWKWebViewcontroller whenSecurityExceptions.hasExceptionsis truthy or aClientCertificateis configured. The default path solves WebAuthn for the 80% case (publicly-trusted certs, no mTLS); the fallback preserves the self-hosted edge cases that motivated the original switch.Promise signature stays
Promise<URL>.Where to patch
based on
authDetails.exceptionsandauthDetails.clientCertificateSources/App/Onboarding/API/OnboardingAuthDetails.swift— already providesschemeforcallbackURLScheme:Tests under
Tests/App/Onboarding/— add coverage for both branchesWhat I can offer
I'm a user, not an iOS developer — I can test on iOS 26 with self-hosted HA + Authentik, file a follow-up issue with logs if needed, but I'm not in a position to submit the PR myself. If a maintainer or community contributor picks this up, I'll happily verify against my setup.