Skip to content

sign-in flow for totp #6626

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

Merged
merged 12 commits into from
Oct 13, 2022
Merged

sign-in flow for totp #6626

merged 12 commits into from
Oct 13, 2022

Conversation

bhparijat
Copy link
Contributor

@bhparijat bhparijat commented Sep 23, 2022

Support sign-in with MFA TOTP.

Builds on top of the changes in #6629

Discussion

  • Read the contribution guidelines (CONTRIBUTING.md).
  • If this has been discussed in an issue, make sure to link to the issue here.
    If not, go file an issue about this before creating a pull request to discuss.

Testing

  • Make sure all existing tests in the repository pass after your change.
  • If you fixed a bug or added a feature, add a new test to cover your code.

API Changes

  • At this time we cannot accept changes that affect the public API. If you'd like to help
    us make Firebase APIs better, please propose your change in an issue so that we
    can discuss it together.

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2022

⚠️ No Changeset found

Latest commit: 599348b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bhparijat bhparijat changed the base branch from master to mfa-totp September 23, 2022 22:02
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 23, 2022

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (3f94477)Merge (572bc14)Diff
    browser160 kB160 kB+412 B (+0.3%)
    esm5208 kB209 kB+609 B (+0.3%)
    main153 kB154 kB+633 B (+0.4%)
    module160 kB160 kB+412 B (+0.3%)
    react-native169 kB169 kB+209 B (+0.1%)
  • @firebase/auth/internal

    TypeBase (3f94477)Merge (572bc14)Diff
    browser171 kB171 kB+412 B (+0.2%)
    esm5222 kB223 kB+609 B (+0.3%)
    main189 kB189 kB+643 B (+0.3%)
    module171 kB171 kB+412 B (+0.2%)
  • @firebase/auth/react-native

    TypeBase (3f94477)Merge (572bc14)Diff
    browser169 kB169 kB+209 B (+0.1%)
    module169 kB169 kB+209 B (+0.1%)
  • firebase

    TypeBase (3f94477)Merge (572bc14)Diff
    firebase-auth-react-native.js150 kB150 kB+101 B (+0.1%)
    firebase-auth.js119 kB120 kB+243 B (+0.2%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/OjTP9Sc9CL.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 23, 2022

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • TotpMultiFactorGenerator

      Size

      TypeBase (3f94477)Merge (572bc14)Diff
      size33.8 kB34.0 kB+252 B (+0.7%)
      size-with-ext-deps54.3 kB54.5 kB+255 B (+0.5%)

      Dependency

      TypeBase (3f94477)Merge (572bc14)Diff
      functions

      52 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isEmptyString
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _logError
      _logoutIfInvalidated
      _makeTaggedError
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      finalizeEnrollTotpMfa
      getAccountInfo
      getIdTokenResult
      getVersionForPlatform
      isUserInvalidated
      mergeProviderData
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      startEnrollTotpMfa
      utcTimestampToDateString

      53 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isEmptyString
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _logError
      _logoutIfInvalidated
      _makeTaggedError
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      finalizeEnrollTotpMfa
      finalizeSignInTotpMfa
      getAccountInfo
      getIdTokenResult
      getVersionForPlatform
      isUserInvalidated
      mergeProviderData
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      startEnrollTotpMfa
      utcTimestampToDateString

      + finalizeSignInTotpMfa

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/F8C7b6nJgl.html

@github-actions github-actions bot added the doc-changes PRs that affect docs label Sep 28, 2022
@bhparijat bhparijat force-pushed the parijat-totp-signin branch from 3a6a099 to a6f495d Compare October 11, 2022 21:55
@bhparijat bhparijat force-pushed the parijat-totp-signin branch from a6f495d to d6618b3 Compare October 11, 2022 22:09
@bhparijat bhparijat requested a review from sam-gc October 12, 2022 04:06
Copy link
Contributor

@sam-gc sam-gc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending final comment 👍

@bhparijat bhparijat force-pushed the parijat-totp-signin branch from 32b2805 to d8ea446 Compare October 13, 2022 16:31
Copy link
Contributor

@sam-gc sam-gc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the force push undid the changes from the pull request

@bhparijat bhparijat force-pushed the parijat-totp-signin branch from afd5eb5 to 32b2805 Compare October 13, 2022 16:53
@bhparijat bhparijat force-pushed the parijat-totp-signin branch from 32b2805 to 599348b Compare October 13, 2022 16:56
@bhparijat bhparijat merged commit 84f4161 into mfa-totp Oct 13, 2022
@bhparijat bhparijat deleted the parijat-totp-signin branch October 13, 2022 19:05
bhparijat added a commit that referenced this pull request Oct 13, 2022
* 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]>
@firebase firebase locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
doc-changes PRs that affect docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants