Support MFA TOTP in web SDK - #7146
Merged
Merged
Conversation
Co-authored-by: Parijat Bhatt <parijatbhatt@google.com>
* Implement TOTP MFA enrollment. This includes changes to mfa_info, addition of TotpMultiFactorImpl and unit tests. * move all TOTP implementation into core/mfa/assertions. We do not need to restrict this to platform_browser. SMS mfa is in platform_browser since it requires a recaptcha step. * Include a reference to Auth in TotpSecret This is cleaner than looking up the app and auth instance with getApp and getAuth. * addressed review comments, added totp subdirectory.
The same pattern is followed in rest of the auth codebase. (ex- src/platform_browser/mfa/assertions/)
* updated readme
* Export TOTP symbols to be picked up by demo app. * Update the demo app to support TOTP enrollment, use local firebase auth version. The QR code image is generated using the qrserver api at https://goqr.me/api/doc/
* Export TOTP symbols to be picked up by demo app. * adding sign-in flow for totp * using only verification code for sign-in * added startSignInTotp method * modified verification code usage in object signin * added mfa enrollment id to finalize signin method: * adding singin for totp in demoapp * made enrollmentId to not be optional * reverting changes in authapi.md * removed unnecessary check and fixed spelling * added back otp check * made _finalizeEnroll && and _finalizeSignin to be async Co-authored-by: Pavithra Ramesh <pavithrar@google.com>
* adding test cases for signing in * fixed test cases to handle async signin
* totp integration test * test cases working with verified email * removing debug logs * changed test email and fixed handling of user delete for totp * reverting unwanted changes in helper.ts * modified comments
* removed delay function and used timestamp for totp generator * updated yarn.lock to show totp-generator * added check for signin after unenroll * adding skippig of totp tests if emulator is being used * using this.skip to skip tests
* Fix type error in totp unit test. * add ts-ignore for totp-generator.
Also changed the demo app to display this field as a countdown.
TOTP only needs a finalize step.
🦋 Changeset detectedLatest commit: 7c2af18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
Size Report 1Affected Products
Test Logs |
Collaborator
Size Analysis Report 1Affected Products
Test Logs |
Contributor
Author
|
@egilmorez @kevinthecheung Can you help review the docs changes? 52efc46 Thanks! |
prameshj
marked this pull request as ready for review
March 27, 2023 18:26
prameshj
requested review from
egilmorez,
lisajian,
markarndt,
renkelvin and
sam-gc
as code owners
March 27, 2023 18:26
sam-gc
approved these changes
Mar 28, 2023
kevinthecheung
approved these changes
Mar 28, 2023
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
kevinthecheung
approved these changes
Mar 28, 2023
kevinthecheung
approved these changes
Mar 28, 2023
kevinthecheung
approved these changes
Mar 28, 2023
egilmorez
reviewed
Mar 28, 2023
egilmorez
left a comment
Contributor
There was a problem hiding this comment.
Approving based on Kevin's review to flip code owner bit. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 adds support for TOTP as a second-factor.
It adds "totp-generator" as a devDependency for integration tests. As a result, yarn.lock changes have been committed as well. These changes were made by yarn.
All individual PRs have been reviewed. Docs changes are the only diff that need review - 0972c84
Testing
API Changes