PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks#6339
PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks#6339david-livefront wants to merge 1 commit intomainfrom
Conversation
| .getEncoder() | ||
| .encodeToString(json.toString().toByteArray(Charsets.UTF_8)) | ||
| val parentParam = URLEncoder.encode(CALLBACK_URI, "UTF-8") | ||
| val parentParam = URLEncoder.encode(callbackUri, "UTF-8") |
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6339 +/- ##
==========================================
+ Coverage 86.30% 86.33% +0.02%
==========================================
Files 783 780 -3
Lines 56432 56313 -119
Branches 8153 8154 +1
==========================================
- Hits 48705 48616 -89
+ Misses 4887 4855 -32
- Partials 2840 2842 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
795738e to
60679da
Compare
|
Great job! No new security vulnerabilities introduced in this pull request |
60679da to
fc73da8
Compare
fc73da8 to
1174c47
Compare
1174c47 to
d702bbf
Compare
ffb771d to
375d447
Compare
375d447 to
3e821aa
Compare
|
Claude finished @david-livefront's task in 4m 7s —— View job Code Review SummaryPR: PM-26577: Support multiple schemes for Duo, WebAuthn, and SSO callbacks OverviewThis PR updates authentication callback handling to support HTTPS app links ( Task List
Findings Summary
Critical IssuesThe previously identified critical issue with backslash path separators in Remaining Issues
|
| EnvironmentRegion.UNITED_STATES -> { | ||
| AuthTabData.HttpsScheme( | ||
| host = "bitwarden.com", | ||
| path = "\\$kind-callback", |
There was a problem hiding this comment.
❌ CRITICAL: The path uses a backslash (\) instead of a forward slash (/). In Kotlin, "\\$kind-callback" produces \duo-callback, but URL paths require forward slashes.
This will cause malformed callback URLs like https://bitwarden.com\duo-callback instead of https://bitwarden.com/duo-callback, breaking authentication callbacks for Duo, WebAuthn, and SSO flows.
| path = "\\$kind-callback", | |
| path = "/$kind-callback", |
There was a problem hiding this comment.
Claude finished @david-livefront's task in 19s —— View job
Verifying Fix
- Verify the backslash path fix in
EnvironmentUrlDataJsonExtensions.kt
✅ Confirmed! The fix looks good. The path now correctly uses "$kind-callback" without the backslash:
AuthTabData.HttpsScheme(
host = "bitwarden.com",
path = "$kind-callback",
)This will produce valid URL paths like duo-callback, webauthn-callback, and sso-callback.
| "?data=eyJjYWxsYmFja1VyaSI6ImJpdHdhcmRlbjovL3dlYmF1dGhuLWNhbGxiYWNrIiwiZ" + | ||
| "GF0YSI6Int9IiwiaGVhZGVyVGV4dCI6ImhlYWRlciIsImJ0blRleHQiOiJidXR0b24iLCJi" + | ||
| "dG5SZXR1cm5UZXh0IjoicmV0dXJuQnV0dG9uIn0=" + |
There was a problem hiding this comment.
Old (in test): {"callbackUri":"bitwarden://webauthn-callback","data":"{}","headerText":"header","btnText":"button","btnReturnText":"returnButton"}
New (in code): {"data":"{}","headerText":"header","btnText":"button","btnReturnText":"returnButton","mobile":true}
The test expectation needs to be updated to match the new JSON structure that the generateUriForWebAuth function now produces.
3e821aa to
64c8a7e
Compare
| ): LoginResult = identityService | ||
| .getToken( | ||
| uniqueAppId = authDiskSource.uniqueAppId, | ||
| deeplinkScheme = environmentRepository.environment.environmentUrlData.appLinksScheme, |
There was a problem hiding this comment.
This is needed specifically for Duo support, since the server generates the redirect url.
The property is fully ignored if the user does not have Duo configured but we do not know that at this time so we must always send it.
| is AuthTabData.HttpsScheme -> { | ||
| AuthTabIntent.Builder() | ||
| .build() | ||
| .launch(launcher, uri, authTabData.host, "\\${authTabData.path}") |
There was a problem hiding this comment.
❌ CRITICAL: The path parameter uses a backslash (\\) instead of a forward slash (/). In Kotlin, "\\${authTabData.path}" produces \duo-callback (with a literal backslash), but URL paths require forward slashes.
This will cause the AuthTab to register callbacks with malformed paths like \duo-callback instead of /duo-callback, breaking authentication redirect verification for Duo, WebAuthn, and SSO flows when using HTTPS app links on devices that support AuthTab.
| .launch(launcher, uri, authTabData.host, "\\${authTabData.path}") | |
| .launch(launcher, uri, authTabData.host, "/${authTabData.path}") |
There was a problem hiding this comment.
Claude finished @david-livefront's task in 1m 0s —— View job
Verification Status
- Verify the backslash issue has been fixed in
IntentManagerImpl.kt
Thanks for the update! However, I'm still seeing the backslash in the current code at IntentManagerImpl.kt:97:
.launch(launcher, uri, authTabData.host, "\\${authTabData.path}")The current commit on the PR branch is 64c8a7e and still contains "\\${authTabData.path}".
If you've committed a fix locally, it may not have been pushed yet. The path should use a forward slash:
.launch(launcher, uri, authTabData.host, "/${authTabData.path}")Let me know if you'd like me to make this fix, or if there's a pending push I should wait for!

🎟️ Tracking
PM-26577
📔 Objective
This PR updates the Duo and WebAuthn logic to send the appropriate deeplink scheme data.
Note: This PR is on hold until the WebConnector logic is updated.
⏰ Reminders before review
🦮 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