Skip to content

PM-26577: Feat: Support multiple schemes for Duo, WebAuthn, and SSO callbacks#6339

Merged
david-livefront merged 1 commit into
mainfrom
PM-26577-app-links-support
Jun 1, 2026
Merged

PM-26577: Feat: Support multiple schemes for Duo, WebAuthn, and SSO callbacks#6339
david-livefront merged 1 commit into
mainfrom
PM-26577-app-links-support

Conversation

@david-livefront
Copy link
Copy Markdown
Collaborator

@david-livefront david-livefront commented Jan 8, 2026

🎟️ Tracking

PM-26577

📔 Objective

This PR updates the Duo and WebAuthn logic to send the appropriate deeplink scheme data.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@david-livefront david-livefront added the ai-review Request a Claude code review label Jan 8, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:misc Change Type - ¯\_(ツ)_/¯ and removed ai-review Request a Claude code review labels Jan 8, 2026
.getEncoder()
.encodeToString(json.toString().toByteArray(Charsets.UTF_8))
val parentParam = URLEncoder.encode(CALLBACK_URI, "UTF-8")
val parentParam = URLEncoder.encode(callbackUri, "UTF-8")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parent param is required by the WebAuthn Connector but it does not really use the value.

I have an open question about what I should be sending here.

@david-livefront david-livefront added the ai-review Request a Claude code review label Jan 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.43%. Comparing base (fa219f6) to head (5ccc8a8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6339      +/-   ##
==========================================
- Coverage   86.66%   86.43%   -0.23%     
==========================================
  Files         901      876      -25     
  Lines       64860    63893     -967     
  Branches     9260     9248      -12     
==========================================
- Hits        56211    55229     -982     
- Misses       5464     5480      +16     
+ Partials     3185     3184       -1     
Flag Coverage Δ
app-data 17.45% <100.00%> (+0.20%) ⬆️
app-ui-auth-tools 18.97% <30.00%> (+0.14%) ⬆️
app-ui-platform 16.44% <0.00%> (+0.03%) ⬆️
app-ui-vault 27.73% <0.00%> (-0.57%) ⬇️
authenticator 6.20% <0.00%> (+<0.01%) ⬆️
lib-core-network-bridge 4.07% <0.00%> (-0.01%) ⬇️
lib-data-ui 1.14% <10.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 795738e to 60679da Compare January 8, 2026 21:53
@github-actions github-actions Bot removed the ai-review Request a Claude code review label Jan 8, 2026
@david-livefront david-livefront changed the title PM-26577: Support multiple schemes for Duo and WebAuthn callbacks PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks Jan 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 8, 2026

Logo
Checkmarx One – Scan Summary & Details0319e43d-3ecf-4f86-abef-2d9d0b2ab80d

Great job! No new security vulnerabilities introduced in this pull request

@david-livefront david-livefront added the ai-review Request a Claude code review label Jan 8, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 60679da to fc73da8 Compare January 8, 2026 23:21
@github-actions github-actions Bot removed the ai-review Request a Claude code review label Jan 8, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from fc73da8 to 1174c47 Compare January 9, 2026 15:10
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 1174c47 to d702bbf Compare January 26, 2026 18:49
@github-actions github-actions Bot removed the t:misc Change Type - ¯\_(ツ)_/¯ label Jan 26, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch 3 times, most recently from ffb771d to 375d447 Compare February 6, 2026 16:47
@david-livefront david-livefront added t:feature-tool Change Type - Internal tool feature or enhancement ai-review Request a Claude code review labels Feb 6, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 375d447 to 3e821aa Compare February 6, 2026 16:50
@github-actions github-actions Bot removed the t:feature-tool Change Type - Internal tool feature or enhancement label Feb 6, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 6, 2026

Claude finished @david-livefront's task in 4m 20s —— View job


Code Review Summary

PR: PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks

Overview

This PR activates HTTPS app links for Duo, WebAuthn, and SSO authentication callbacks on known environments (US, EU, Internal), replacing the bitwarden:// custom URI scheme with https:// scheme. Self-hosted environments continue to use the custom scheme. This is a security improvement -- HTTPS app links with autoVerify="true" are resistant to scheme hijacking compared to custom URI schemes.

Changes Reviewed

File Change
AndroidManifest.xml Added bitwarden.pw host for Internal environment app link verification
EnvironmentUrlDataJsonExtensions.kt (app) Switched US/EU/Internal from CustomScheme to HttpsScheme with correct host/path mappings
EnvironmentUrlDataJsonExtensions.kt (data) Returns "https" for US/EU/Internal appLinksScheme
AuthRepositoryTest.kt Updated DEEPLINK_SCHEME from "bitwarden" to "https"
EnvironmentUrlDataJsonExtensionsTest.kt (app) Updated all assertions to use HttpsScheme with correct hosts
EnvironmentUrlsDataJsonExtensionsTest.kt (data) Updated expected scheme to "https" for US/EU/Internal
EnterpriseSignOnViewModelTest.kt Updated SSO AuthTabData expectations
TwoFactorLoginViewModelTest.kt Updated Duo and WebAuthn AuthTabData expectations

Findings

No new issues found in this PR's changed code.

Category Status
Security HTTPS app links improve security over custom URI schemes
Correctness Environment-to-host mapping is correct (US=bitwarden.com, EU=bitwarden.eu, Internal=bitwarden.pw)
Manifest Intent filter with autoVerify="true" correctly lists all three hosts and path patterns
Backward Compat Self-hosted environments retain bitwarden:// custom scheme -- no breaking change
Test Coverage All environment types and callback kinds (duo, webauthn, sso) covered; Codecov confirms 100% on modified lines
Model correctness HttpsScheme.callbackUrl computes as "https://$host/$path" (e.g., https://bitwarden.com/duo-callback)
TODO cleanup All // TODO: PM-26577 comments properly removed

Pre-existing Issue (not in this PR's diff)

⚠️ IntentManagerImpl.kt line 97 on main still contains "\\${authTabData.path}" which produces a backslash-prefixed path (e.g., \duo-callback instead of /duo-callback). This was introduced in PM-31953 and has an existing unresolved thread on this PR.

This matters for this PR because it activates the HttpsScheme code path for US/EU/Internal environments for the first time. On devices that support AuthTab, AuthTabIntent.launch() will receive \duo-callback instead of /duo-callback, which may break authentication redirect verification. The fix is to change "\\" to "/" in IntentManagerImpl.kt:97. This should be addressed before or alongside merging.


Reviewed by Claude Code -- Re-review after rebase onto main (bb33db6). No issues in the PR diff itself.

@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 3e821aa to 64c8a7e Compare February 6, 2026 20:46
@david-livefront david-livefront added the t:feature-tool Change Type - Internal tool feature or enhancement label Feb 6, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 64c8a7e to 59c70c1 Compare February 10, 2026 21:02
@github-actions github-actions Bot removed the t:feature-tool Change Type - Internal tool feature or enhancement label Feb 10, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch 2 times, most recently from 9b129e3 to 26c74a3 Compare February 17, 2026 15:58
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 26c74a3 to bb33db6 Compare March 9, 2026 18:21
@david-livefront david-livefront added the t:feature-tool Change Type - Internal tool feature or enhancement label Mar 9, 2026
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from bb33db6 to db7ae1c Compare May 18, 2026 21:04
@github-actions github-actions Bot removed the t:feature-tool Change Type - Internal tool feature or enhancement label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR completes the planned migration from custom-scheme callbacks (bitwarden://) to HTTPS app links for the predefined US/EU/INTERNAL environments, removing the TODO: PM-26577 markers. AuthTabData.HttpsScheme is now returned by duoAuthTabData, webAuthnAuthTabData, and ssoAuthTabData for those regions, and appLinksScheme returns "https" for them while SELF_HOSTED continues to use the bitwarden scheme. The AuthCallbackActivity intent-filter adds bitwarden.pw alongside bitwarden.com/bitwarden.eu, and the legacy bitwarden://*-callback intent-filters remain in place as a fallback. Unit tests across AuthRepositoryTest, EnvironmentUrlDataJsonExtensionsTest, EnvironmentUrlsDataJsonExtensionsTest, EnterpriseSignOnViewModelTest, and TwoFactorLoginViewModelTest have been updated consistently with the new expectations.

Code Review Details

No findings.

Notes (informational, not blocking):

  • The PR description notes this was on hold pending WebConnector updates; confirm those server-side changes are deployed before this is merged so that Duo/SSO/WebAuthn flows resolve to https://bitwarden.{com,eu,pw}/<kind>-callback correctly.
  • The HTTPS app link behavior depends on Digital Asset Links (assetlinks.json) being served from the three apex hosts so that autoVerify="true" succeeds; this is an operational concern outside the diff.

@david-livefront david-livefront marked this pull request as ready for review May 18, 2026 21:19
@david-livefront david-livefront requested a review from a team as a code owner May 18, 2026 21:19
@david-livefront david-livefront requested a review from vvolkgang May 18, 2026 21:38
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from db7ae1c to 99e58d1 Compare May 21, 2026 16:04
@david-livefront david-livefront force-pushed the PM-26577-app-links-support branch from 99e58d1 to 5ccc8a8 Compare June 1, 2026 14:17
@david-livefront david-livefront changed the title PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks PM-26577: Feat: Support multiple schemes for Duo, WebAuthn, and SSO callbacks Jun 1, 2026
@github-actions github-actions Bot added the t:feature Change Type - Feature Development label Jun 1, 2026
@david-livefront david-livefront added ai-review-vnext Request a Claude code review using the vNext workflow and removed ai-review Request a Claude code review labels Jun 1, 2026
Copy link
Copy Markdown
Member

@vvolkgang vvolkgang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@david-livefront
Copy link
Copy Markdown
Collaborator Author

Thanks @vvolkgang

@david-livefront david-livefront added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 227359b Jun 1, 2026
30 of 32 checks passed
@david-livefront david-livefront deleted the PM-26577-app-links-support branch June 1, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants