[PM-28349] feat: Support https:// redirects for SSO and Duo auth connectors#2814
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the region-gated HTTPS auth-connector callback change for SSO and Duo. The core logic — Code Review DetailsNo findings above the reporting threshold. Notes from the validation pass (no action required):
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2814 +/- ##
==========================================
- Coverage 80.84% 78.67% -2.18%
==========================================
Files 1022 1146 +124
Lines 65053 72422 +7369
==========================================
+ Hits 52593 56978 +4385
- Misses 12460 15444 +2984 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Looks good, really like the RegionType simplification for base URLs.
Just a small question and it seems that Codecov has caught 24 lines not being tested in AuthService although it's the switch resolveCallback(for: callbackKind) block which I'm not sure if we can test it correctly.
Correct, there's no way to get at the URL or parameters used to create the |
🎟️ Tracking
PM-28349
📔 Objective
Our mobile authentication connectors currently complete the
ASWebAuthenticationSessionflow at the end of the SSO and Duo flows using a custombitwarden://URL scheme. This adds support for switching this to a HTTPS callback URL for Cloud users (US, EU, and Internal regions)What changed:
AuthServicefromEnvironmentService.region. Cloud regions use anhttps://{apexHost}/{sso,duo}-callbackcallback at the region's fixed apex host (US→bitwarden.com, EU→bitwarden.eu, Internal→bitwarden.pw); self-hosted continues to usebitwarden://.RegionType.internalfor Bitwarden'sbitwarden.pw(QA/Internal) environments. It is hidden from the region picker and detected automatically bybitwarden.pwhost suffix (EnvironmentService.region/EnvironmentURLData.region). The apex host comes fromRegionType.authCallbackHost.ASWebAuthenticationSession.Callback.https(host:path:)is used to intercept thehttps://redirect for SSO and Duo. This API is iOS 17.4+, and the deployment target is iOS 15.0, so it is@available-gated: Cloud users on iOS < 17.4 transparently fall back to the existingbitwarden://callback.redirect_urifollows the same region/availability resolution so the value sent to the identity provider always matches the callback the app intercepts.AuthServicefactory (the coordinator retains presentation/start). The now-unusedcallbackUrlSchemeparameter is removed fromAuthRoute.singleSignOn.Scope notes:
ASAuthorizationController), not a connector callback URL; only the self-hosted connector useswebauthn-callback, and self-hosted remains onbitwarden://.