feat: remove platform attachment requirement on registration #331
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.
Description
Remove platform attachment requirement on registration and change
isUserVerifyingPlatformAuthenticatorAvailable
calls to the general Webauthn availability check.Implementation
Safari currently (v. 16.2) does not provide a UI in case of a (registration) ceremony being performed with an authenticator NOT protected by e.g. a PIN. While Chromium based browsers do offer a UI guiding through the setup of a PIN, Safari simply performs the ceremony without then setting the UV flag even if it is required. On finalization in the backend, this ultimately leads to an error of in the
webauthn
library which is then "swallowed" by being mapped to a generic error response ("Failed to validate attestation"). In order to provide an appropriate error message to the frontend/user, I had to return an error response distinguishable from other error cases so thewebauthn
handler now returns an HTTP error with adedicated/separate HTTP status code (i.e. NOT "Bad request") because it seemed a bit more robust than forcing the frontend to check on a matching (sub-)string in the error message in order to properly display the error.
Tests
The changes add e2e test runs to check whether WebAuthn credentials now allow for transports other than
platform
. However, the e2e tests do not test the above mentioned implemented error handling for user verification failures because:How to test
Run the tests or/and run the quickstart.