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
];
Description
When migrating users between Firebase projects or performing backups using the Firebase CLI commands
firebase auth:exportandfirebase 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
TODOcomments 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 (
downloadAccountendpoint) are filtered using a whitelist.EXPORTED_JSON_KEYSmisses themfaInfokey: