Skip to content

bug: auth:export and auth:import silently discard MFA user data (mfaInfo) #10704

Description

@VishalRaut2106

Description

When migrating users between Firebase projects or performing backups using the Firebase CLI commands firebase auth:export and firebase auth:import, Multi-Factor Authentication (MFA) enrollment configurations (mfaInfo) are silently discarded.

MFA runtime support was introduced to the Firebase Auth Emulator in PR #3173, but support was never extended to the CLI import/export tools, leaving two TODO comments in the codebase.


Technical Details & Code Analysis

1. Exporter Limitations (src/accountExporter.ts)

In accountExporter.ts, the user objects returned from the Google Identity Toolkit REST API (downloadAccount endpoint) are filtered using a whitelist.

  • EXPORTED_JSON_KEYS misses the mfaInfo key:
    const EXPORTED_JSON_KEYS = [
      "localId",
      "email",
      "emailVerified",
      "passwordHash",
      ... // mfaInfo is missing here
    ];

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions