-
Notifications
You must be signed in to change notification settings - Fork 156
Push id.ai credentials at the end for 1.0 RP ID calculation #3345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies WebAuthn flow ordering to improve the 1.0 authentication experience after identity upgrades by ensuring that credentials from "new flow" origins (like id.ai) are prioritized last when determining which RP ID to use for authentication.
- Updates
findWebAuthnFlows
function to sort devices so those registered on new flow origins are moved to the end - Replaces
Set
-based duplicate removal withreduce
method to maintain order - Adds comprehensive tests to verify the new ordering behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/frontend/src/lib/utils/findWebAuthnFlows.ts | Implements custom sorting logic to push new flow origin devices to end and replaces duplicate removal method |
src/frontend/src/lib/utils/findWebAuthnFlows.test.ts | Adds test case and mock configuration to verify new flow origins are ordered last |
src/frontend/src/lib/utils/iiConnection.test.ts | Adds test case and mock configuration to verify login behavior with new flow origins |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
af5c909
to
80d9dd1
Compare
Motivation
We are seeing problems when users log in 1.0 after upgrading their identity.
Context:
The problem comes when users don't know where passkeys are stored. Therefore, the passkey that they use to authenticate in 1.0 is not in the same place where they upgraded. Which triggers a new UX for the user that confuses them because they were used to a different UX.
For example, we saw a user that had the passkey in 1.0 in iCloud. They were used to authenticate with the fingerprint right after clicking the identity number in 1.0. However, during the upgrade, they passkey was created in their Google Password Manager. Next time they went to authenticate in 1.0, the WebAuthn browser modal showed a modal to choose that passkey, instead of requesting the fingerprint immediately. That confused the user.
We have seen other similar reports in the forum of users having problems after upgrading.
Changes
This pull request updates the logic for ordering WebAuthn flows in
findWebAuthnFlows
to ensure that devices registered on "new flow" origins are moved to the end of the list, while preserving their relative order. It also adds corresponding tests to verify this behavior.findWebAuthnFlows
function now sorts devices so those registered on origins listed incanisterConfig.new_flow_origins
are placed at the end, preserving the relative order within each group. This is implemented using a custom sort function.reduce
instead of relying onSet
, maintaining the order.Tests
new_flow_origins
are pushed to the end of the flows, maintaining the relative order of devices.canisterConfig
are added in the test setup to simulate the presence ofnew_flow_origins
.