Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

feat: discoverable login flow #129

Closed
wants to merge 2 commits into from
Closed

feat: discoverable login flow #129

wants to merge 2 commits into from

Conversation

james-d-elliott
Copy link
Contributor

@james-d-elliott james-d-elliott commented Feb 18, 2022

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. The requireResidentKey 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 the protocol.ParseCredentialRequestResponseBody / webauthn.ValidateDiscoverableLogin methods directly rather than relying on webauthn.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:

  • Decide if it's better for us to provide the kid with the UserHandle in the discoverable lookup func. This would allow a fully discoverable process where the server has no need to record the user information.

This implements methods to adequately perform discoverable logins (i.e. passwordsless authentication).
@james-d-elliott
Copy link
Contributor Author

james-d-elliott commented Feb 18, 2022

I decided to split this as while the feats are semi-related there is several other aspects of L2 that we should probably figure out and sort out.

Discoverable Logins: #132
Resident Key Parameter: #133

@james-d-elliott james-d-elliott deleted the feat-discoverable-login-flow branch February 18, 2022 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant