This repository was archived by the owner on Dec 5, 2022. It is now read-only.
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 adds tooling to help facilitate discoverable logins. In addition it adds the Webauthn Level 2
residentKey
parameter (which as far as I can see was the major change in this revision) as per https://www.w3.org/TR/webauthn/#dom-authenticatorselectioncriteria-residentkey. TherequireResidentKey
parameter remains for backwards comparability reasons, and a setter for the credential creation options was added to simplify the logic.See here for additional details about level 2: https://developers.yubico.com/WebAuthn/Concepts/WebAuthn_Level_2_Features_and_Enhancements.html
The way the discoverable flow has been implemented relies on users utilizing a helper function (interface) to retrieve user credentials utilizing the
userHandle
. It breaks up the functions into the common elements and elements only required for standard logins and elements only required for discoverable logins.In addition it requires people utilize
protocol.ParseCredentialCreationResponseBody
/webauthn.CreateCredential
and theprotocol.ParseCredentialRequestResponseBody
/webauthn.ValidateDiscoverableLogin
methods directly rather than relying onwebauthn.FinishRegistration
/webauthn.FinishLogin
methods. This is primarily for backwards compatibility but in addition it prevents unintentional discoverable logins from occurring.This should be completely backwards compatible and appears to be in my testing. I can provide a reference implementation utilizing all these elements if desired.
ToDo: