LG-8071: Add logging for WebAuthn frontend error reasons#7609
Merged
Conversation
mitchellhenke
approved these changes
Jan 10, 2023
changelog: Internal, Analytics, Track error reasons for failed WebAuthn authentication
7a0b5c5 to
1d4a1cb
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎫 Ticket
LG-8071
🛠 Summary of changes
Enhances WebAuthn verification to ensure that errors occurring in the front-end are logged as part of the back-end verification.
Previously, the frontend error message was being passed as part of the form submission, but was only used as part of a condition considering whether to validate the assertion response. With these changes, the error is now included in the logged error details.
This changes the specific string being logged from using the full error message to the error name, which avoids differences in error messages between browsers.
For example, a cancelled authentication...
error.name:NotAllowedErrorerror.message:The operation either timed out or was not allowed. See: https://www.w3.org/TR/webauthn-2/#sctn-privacy-considerations-client.error.name:NotAllowedErrorerror.message:This request has been cancelled by the user.Draft while I work to enhance test coverage
📜 Testing Plan
tail -F log/events.log | jq .)"Multi-Factor Authentication"witherrorsincludingwebauthn_error: ['NotAllowedError']