Feat/mfa recover self serve#1014
Merged
isabeleliassen merged 49 commits intocsg-org:developmentfrom Aug 26, 2025
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We are planning on enforcing MFA for practitioners in the system. In the event that a practitioner loses their MFA device (ie their phone breaks) they will need a way to recover their account and reset their MFA. AWS Cognito does not support this out of the box. We need to implement a custom solution for this which will delete the old Cognito user account and recreate them with a new invite/temporary password. From there they can log in and reset a new password as well as their MFA option.
This recovery process includes the following steps:
User requests MFA reset by submitting username / password and license info
Backend verifies the provided license data matches one of the license records.
That endpoint attempts the first leg of authentication server-to-server against Cognito; validates that the password authentication step was successful
Backend then sends a link to the user's email confirming they want to reset their MFA. The link includes a recovery token, which has a 15 minute expiry.
The link lands the user on a frontend page that attempts to validate the recovery token against the backend. If successful, the backend deletes and then recreates the user's Cognito account, which sends a new invitation email
From there the user can use the invitation email with the temp password to continue and setup their new account
Closes #982
Summary by CodeRabbit
New Features
Chores
Documentation
Tests