DRAFT: New MFA Option: Passkeys #37
Draft
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 is a draft. There are known issues and tests may not pass.
This PR adds a new two-factor authentication option to Registry - the “Passkey” option. This option allows for users to enroll a device, such as the laptop they use to access Registry, with a “Passkey” for authentication. This is in addition to current password authentication, not replacing it. The Passkey implementation is based on the WebAuthN library and FIDO2 standards. More information on the architecture can be found in the feature specification.
New additions include: * A new route used to begin the passkey registration.
All routes are accessible by APTrust sysadmins, Institutional Admins, and Institutional Users - any type of user may enroll themselves in the passkey option.
Constants have been added including a formal name for this two-factor option (“Passkey”) and a short name for this option to identify it if selected by the user.
A database migration is necessary because we need to store a user session and credential for each user who enrolls in this option.
By visiting the “My Account” page and selecting the “Set up Two-Factor Auth” button, users can view the Passkey option as selectable alongside the other current options - Authy, which is being phased out, and SMS, alongside the option to turn off 2FA entirely. If the user selects the option to use Passkeys and clicks on Submit, the user will be taken to the Passkey enrollment page where further instructions are provided. Provided that the user is using a modern, compatible device and browser, a prompt will pop up with built-in UI to walk the user through the enrollment process.
A new external library has been introduced:
Documentation has been added describing this new option in notes.md.
The pgmodel for users has been updated to add the new session and credential fields, as well as a method to detect if the user has opted in for the Passkey method.
The passkey prompt has been added to the multi-factor authentication page.
Testing:
Documentation has been added to the User Guide in a separate PR.