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.
This PR makes SimpleWebAuthn more opinionated about default functionality, and the use case it promotes. In this case the defaults will steer RP's towards implementing passwordless authentication thusly:
"preferred"
in registration and authentication options (WebAuthn defaults to this value whenuserVerification
is missing in options)uv:true
) during registration and authentication response verificationThese changes were inspired by recent doc updates made to passkeys.dev on how RP's should mark user verification
"preferred"
, but leaves it up to RP's to figure out if UV should be required or not in response validation:I'm deciding to make RP's require that user verification is marked
true
in the response to ensure a reliable passwordless experience.THIS IS A BREAKING CHANGE!
RP's that do not require support for discoverable credentials from authenticators will need to update their calls to
generateRegistrationOptions()
accordingly:Before
After
Additionally, RP's implementing a second-factor flow with WebAuthn, where UV is not important (because username+password are provided before WebAuthn is leveraged for the second factor), should not require user verification when verifying responses:
verifyRegistrationResponse()
Before
After
verifyAuthenticationResponse()
Before
After