Skip to content
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

Merged
merged 26 commits into from
Mar 28, 2023
Merged

Support MFA TOTP in web SDK #7146

merged 26 commits into from
Mar 28, 2023

Conversation

prameshj
Copy link
Contributor

@prameshj prameshj commented Mar 22, 2023

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

  • Added new integration + unit tests for the new feature. Integration tests use the real backend.

API Changes

bhparijat and others added 16 commits March 20, 2023 16:37
* 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/)
* 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-bot
Copy link

changeset-bot bot commented Mar 22, 2023

🦋 Changeset detected

Latest commit: 7c2af18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/auth Patch
@firebase/auth-compat Patch
firebase Patch

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 22, 2023

Size Report 1

Affected Products

  • @firebase/analytics

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    browser20.1 kB20.9 kB+782 B (+3.9%)
    esm524.8 kB25.6 kB+778 B (+3.1%)
    main26.1 kB26.9 kB+778 B (+3.0%)
    module20.1 kB20.9 kB+782 B (+3.9%)
  • @firebase/auth

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    browser157 kB160 kB+3.86 kB (+2.5%)
    cordova184 kB184 kB+462 B (+0.3%)
    esm5205 kB210 kB+5.01 kB (+2.4%)
    main148 kB154 kB+5.56 kB (+3.7%)
    module157 kB160 kB+3.86 kB (+2.5%)
    react-native168 kB170 kB+1.16 kB (+0.7%)
  • @firebase/auth/cordova

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    browser184 kB184 kB+462 B (+0.3%)
    module184 kB184 kB+462 B (+0.3%)
  • @firebase/auth/internal

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    browser167 kB171 kB+3.86 kB (+2.3%)
    esm5218 kB223 kB+5.01 kB (+2.3%)
    main184 kB190 kB+5.53 kB (+3.0%)
    module167 kB171 kB+3.86 kB (+2.3%)
  • @firebase/auth/react-native

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    browser168 kB170 kB+1.16 kB (+0.7%)
    module168 kB170 kB+1.16 kB (+0.7%)
  • bundle

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    analytics (logEvent)43.1 kB43.5 kB+433 B (+1.0%)
  • firebase

    TypeBase (0e1f12c)Merge (2e8e12a)Diff
    firebase-analytics-compat.js25.8 kB26.2 kB+419 B (+1.6%)
    firebase-analytics.js24.9 kB25.3 kB+400 B (+1.6%)
    firebase-auth-compat.js126 kB126 kB+144 B (+0.1%)
    firebase-auth-cordova.js138 kB138 kB+193 B (+0.1%)
    firebase-auth-react-native.js150 kB150 kB+544 B (+0.4%)
    firebase-auth.js117 kB120 kB+2.34 kB (+2.0%)
    firebase-compat.js750 kB751 kB+563 B (+0.1%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 22, 2023

Size Analysis Report 1

Affected Products

  • @firebase/analytics

    • getAnalytics

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.99 kB10.4 kB+432 B (+4.3%)
      size-with-ext-deps43.0 kB43.4 kB+433 B (+1.0%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getAnalytics
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      initializeAnalytics
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getAnalytics
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      initializeAnalytics
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • initializeAnalytics

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.88 kB10.3 kB+432 B (+4.4%)
      size-with-ext-deps36.1 kB36.6 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      22 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      initializeAnalytics
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      24 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      initializeAnalytics
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • isSupported

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.77 kB10.2 kB+430 B (+4.4%)
      size-with-ext-deps35.7 kB36.1 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      22 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      isSupported
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      24 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      isSupported
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • logEvent

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.63 kB10.1 kB+430 B (+4.5%)
      size-with-ext-deps35.6 kB36.0 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      21 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setAnalyticsCollectionEnabled

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.80 kB10.2 kB+431 B (+4.4%)
      size-with-ext-deps35.7 kB36.2 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setAnalyticsCollectionEnabled
      setAnalyticsCollectionEnabled$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setAnalyticsCollectionEnabled
      setAnalyticsCollectionEnabled$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setConsent

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.76 kB10.2 kB+434 B (+4.4%)
      size-with-ext-deps35.7 kB36.1 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      _setConsentDefaultForInit
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setConsent
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      _setConsentDefaultForInit
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setConsent
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setCurrentScreen

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.88 kB10.3 kB+431 B (+4.4%)
      size-with-ext-deps35.8 kB36.3 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setCurrentScreen
      setCurrentScreen$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setCurrentScreen
      setCurrentScreen$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setDefaultEventParameters

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.75 kB10.2 kB+434 B (+4.5%)
      size-with-ext-deps35.7 kB36.1 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      _setDefaultEventParametersForInit
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setDefaultEventParameters
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      _setDefaultEventParametersForInit
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setDefaultEventParameters
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setUserId

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.86 kB10.3 kB+431 B (+4.4%)
      size-with-ext-deps35.8 kB36.2 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setUserId
      setUserId$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setUserId
      setUserId$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • setUserProperties

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.94 kB10.4 kB+431 B (+4.3%)
      size-with-ext-deps35.9 kB36.3 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      23 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setUserProperties
      setUserProperties$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      25 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      setUserProperties
      setUserProperties$1
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

    • settings

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size9.76 kB10.2 kB+430 B (+4.4%)
      size-with-ext-deps35.7 kB36.1 kB+433 B (+1.2%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions

      22 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      settings
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      24 dependencies

      _initializeAnalytics
      attemptFetchDynamicConfigWithRetry
      createGtagTrustedTypesScriptURL
      createTrustedTypesPolicy
      factory
      fetchDynamicConfig
      fetchDynamicConfigWithRetry
      findGtagScriptOnPage
      getHeaders
      getOrCreateDataLayer
      gtagOnConfig
      gtagOnEvent
      insertScriptTag
      isRetriableError
      logEvent
      logEvent$1
      promiseAllSettled
      registerAnalytics
      setAbortableTimeout
      settings
      validateIndexedDB
      warnOnBrowserContextMismatch
      wrapGtag
      wrapOrCreateGtag

      + createGtagTrustedTypesScriptURL
      + createTrustedTypesPolicy

  • @firebase/auth

    • FactorId

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size31.5 kB31.5 kB+12 B (+0.0%)
      size-with-ext-deps52.2 kB52.2 kB+12 B (+0.0%)
    • TotpMultiFactorGenerator

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size?34.0 kB? (?)
      size-with-ext-deps?54.8 kB? (?)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions?

      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

      ?
      classes?

      17 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorAssertionImpl
      NetworkTimeout
      PersistenceUserManager
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpMultiFactorAssertionImpl
      TotpMultiFactorGenerator
      TotpSecret
      UserImpl
      UserMetadata

      ?
      variables?

      DEFAULT_API_TIMEOUT_MS
      DEFAULT_ID_TOKEN_MAX_AGE
      SERVER_ERROR_MAP
      _DEFAULT_AUTH_ERROR_FACTORY
      inMemoryPersistence
      instanceCache
      logClient
      name
      prodErrorMap
      version

      ?
      enums??

      External Dependency

      ModuleBase (0e1f12c)Merge (2e8e12a)Diff
      @firebase/app?

      SDK_VERSION
      _registerComponent
      registerVersion

      ?
      @firebase/component?

      Component

      ?
      @firebase/logger?

      LogLevel
      Logger

      ?
      @firebase/util?

      11 dependencies

      ErrorFactory
      FirebaseError
      base64Decode
      createSubscribe
      getExperimentalSetting
      getModularInstance
      getUA
      isBrowserExtension
      isMobileCordova
      isReactNative
      querystring

      ?
      tslib?

      __rest

      ?
    • TotpSecret

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size?32.4 kB? (?)
      size-with-ext-deps?53.1 kB? (?)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      functions?

      49 dependencies

      _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
      getAccountInfo
      getIdTokenResult
      getVersionForPlatform
      isUserInvalidated
      mergeProviderData
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      utcTimestampToDateString

      ?
      classes?

      14 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      NetworkTimeout
      PersistenceUserManager
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpSecret
      UserImpl
      UserMetadata

      ?
      variables?

      DEFAULT_API_TIMEOUT_MS
      DEFAULT_ID_TOKEN_MAX_AGE
      SERVER_ERROR_MAP
      _DEFAULT_AUTH_ERROR_FACTORY
      inMemoryPersistence
      instanceCache
      logClient
      name
      prodErrorMap
      version

      ?
      enums??

      External Dependency

      ModuleBase (0e1f12c)Merge (2e8e12a)Diff
      @firebase/app?

      SDK_VERSION
      _registerComponent
      registerVersion

      ?
      @firebase/component?

      Component

      ?
      @firebase/logger?

      LogLevel
      Logger

      ?
      @firebase/util?

      11 dependencies

      ErrorFactory
      FirebaseError
      base64Decode
      createSubscribe
      getExperimentalSetting
      getModularInstance
      getUA
      isBrowserExtension
      isMobileCordova
      isReactNative
      querystring

      ?
      tslib?

      __rest

      ?
    • checkActionCode

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size32.7 kB32.8 kB+160 B (+0.5%)
      size-with-ext-deps53.4 kB53.5 kB+160 B (+0.3%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      classes

      15 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      UserImpl
      UserMetadata

      16 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpMultiFactorInfoImpl
      UserImpl
      UserMetadata

      + TotpMultiFactorInfoImpl

    • getMultiFactorResolver

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size34.2 kB34.4 kB+160 B (+0.5%)
      size-with-ext-deps54.9 kB55.1 kB+160 B (+0.3%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      classes

      18 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      MultiFactorResolverImpl
      MultiFactorSessionImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      UserCredentialImpl
      UserImpl
      UserMetadata

      19 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      MultiFactorResolverImpl
      MultiFactorSessionImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpMultiFactorInfoImpl
      UserCredentialImpl
      UserImpl
      UserMetadata

      + TotpMultiFactorInfoImpl

    • multiFactor

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size33.6 kB33.8 kB+160 B (+0.5%)
      size-with-ext-deps54.4 kB54.5 kB+160 B (+0.3%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      classes

      17 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      MultiFactorSessionImpl
      MultiFactorUserImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      UserImpl
      UserMetadata

      18 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      MultiFactorSessionImpl
      MultiFactorUserImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpMultiFactorInfoImpl
      UserImpl
      UserMetadata

      + TotpMultiFactorInfoImpl

    • verifyPasswordResetCode

      Size

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      size32.7 kB32.9 kB+160 B (+0.5%)
      size-with-ext-deps53.4 kB53.6 kB+160 B (+0.3%)

      Dependency

      TypeBase (0e1f12c)Merge (2e8e12a)Diff
      classes

      15 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      UserImpl
      UserMetadata

      16 dependencies

      AuthImpl
      AuthInterop
      AuthMiddlewareQueue
      Delay
      FetchProvider
      InMemoryPersistence
      MultiFactorInfoImpl
      NetworkTimeout
      PersistenceUserManager
      PhoneMultiFactorInfoImpl
      ProactiveRefresh
      StsTokenManager
      Subscription
      TotpMultiFactorInfoImpl
      UserImpl
      UserMetadata

      + TotpMultiFactorInfoImpl

Test Logs

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

@prameshj prameshj changed the title Support MFA TOTP enrollment + sign in in web SDK Support MFA TOTP in web SDK Mar 27, 2023
@prameshj
Copy link
Contributor Author

@egilmorez @kevinthecheung Can you help review the docs changes? 52efc46 Thanks!

@prameshj prameshj marked this pull request as ready for review March 27, 2023 18:26
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/mfa/assertions/totp.ts Outdated Show resolved Hide resolved
packages/auth/src/model/public_types.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@dwyfrequency dwyfrequency left a comment

Choose a reason for hiding this comment

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

LGTM

@hsubox76 hsubox76 merged commit 58bae87 into master Mar 28, 2023
@hsubox76 hsubox76 deleted the mfa-totp-2 branch March 28, 2023 23:33
Copy link
Contributor

@egilmorez egilmorez left a 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!

@google-oss-bot google-oss-bot mentioned this pull request Mar 29, 2023
dwyfrequency pushed a commit that referenced this pull request Apr 13, 2023
@firebase firebase locked and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants