LG-14052: Convert mismatched WebAuthn platform attachment#11788
Conversation
There was a problem hiding this comment.
IMO it's clearer to have one manually defined method than two auto-genned ones
| attr_reader :skip_multiple_mfa_validation | |
| alias_method :skip_multiple_mfa_validation?, :skip_multiple_mfa_validation | |
| def skip_multiple_mfa_validation? | |
| !!@skip_multiple_mfa_validation | |
| end |
There was a problem hiding this comment.
Hm, I kinda like the attr_reader approach, though I do wish it were possible to alias in one go (would love something like attr_reader :skip_multiple_mfa_validation, as: :skip_multiple_mfa_validation?).
I recently discovered Ruby 3 "endless method" syntax, maybe this is a good use-case?
| attr_reader :skip_multiple_mfa_validation | |
| alias_method :skip_multiple_mfa_validation?, :skip_multiple_mfa_validation | |
| def skip_multiple_mfa_validation? = @skip_multiple_mfa_validation |
There was a problem hiding this comment.
I'm not used to the endless methods yet so if it were up to me, I'd stick with my suggestion! But even the PR as-is is probably fine, this is not that crucial to me
a59bdfe to
97ae0c8
Compare
|
Marking ready for review after merge of #11795, but this cannot be merged until that other pull request is fully deployed to production. |
97ae0c8 to
582e74f
Compare
kevinsmaster5
left a comment
There was a problem hiding this comment.
Tested locally and behaves as expected.
Changes LGTM 👍
changelog: User-Facing Improvements, Multi-Factor Authentication, Convert Security Key to Face or Touch Unlock when detected as platform authenticator
3e8097b to
c6787e4
Compare
🎫 Ticket
LG-14052
🛠 Summary of changes
Updates Security Key and Face or Touch Unlock setup to automatically convert to the other if the reported transports are inconsistent with the expected platform attachment.
As outlined in the Testing Plan, despite hints that we provide to the browser to try to ensure that the user sets up a WebAuthn credential with the intended platform attachment, it is still often possible for a user to set up an authenticator of the other type (e.g. Chrome's "Save another way"). In these scenarios, converting the credential to the inferred type will ensure that the user has a better sign-in experience and that our usage tracking is more accurate to the actual type of authenticator used. Previous investigation found that a majority of "Security Key" enrollments are, in-fact, platform authenticators.
This is the second of two pull requests, using routes implemented in #11795. Those changes must be fully deployed to production before this can be merged.
📜 Testing Plan
Verify mismatched behavior displays confirmation prompt as expected:
Setting up Security Key using a platform authenticator:
Setting up Security Key using a platform authenticator:
The steps below are currently hypothetical, but my own testing reveals that it is not possible to complete Step 5 in tested supported browsers.
† Creating a new account can be a useful test case, since the application currently has some assumptions about not permitting a user to delete their only MFA, but the process of "Undo"-ing a mismatched WebAuthn credential requires that we allow a user to delete their only MFA during account creation.
👀 Screenshots