-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MFA TOTP in web SDK #7146
Conversation
Co-authored-by: Parijat Bhatt <[email protected]>
* 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 <[email protected]>
* 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 |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
@egilmorez @kevinthecheung Can you help review the docs changes? 52efc46 Thanks! |
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving based on Kevin's review to flip code owner bit. Thanks!
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