firebase - 我可以将 auth:import 和 auth:export 工具与 Firebase Auth Emulator 一起使用吗?
问题描述
我想在 firebase auth 模拟器启动时使用我的测试用户帐户预加载它,就像我为 Firestore 模拟器及其导入/导出选项所做的那样。我在模拟器运行时尝试使用 auth:import 和 auth:export,但它连接到我们实际的开发 firebase 项目,而不是模拟器。无论如何要针对身份验证模拟器运行 auth:import 和 auth:export 吗?
作为参考,我指的是这些命令(https://firebase.google.com/docs/cli/auth)和这个模拟器(https://firebase.google.com/docs/emulator-suite/connect_auth)。
解决方案
执行此操作的功能现已添加到 firebase 工具中
较旧的答案仍然有效并且可能有用
https://github.com/firebase/firebase-tools/releases/tag/v9.1.0
支持模拟器:Auth Emulator (#2955) 的导出和导入。
firebase help auth:import
Usage: firebase auth:import [options] [dataFile]
import users into your Firebase project from a data file(.csv or .json)
Options:
--hash-algo <hashAlgo> specify the hash algorithm used in password for these accounts
--hash-key <hashKey> specify the key used in hash algorithm
--salt-separator <saltSeparator> specify the salt separator which will be appended to salt when verifying password. only used by SCRYPT now.
--rounds <rounds> specify how many rounds for hash calculation.
--mem-cost <memCost> specify the memory cost for firebase scrypt, or cpu/memory cost for standard scrypt
--parallelization <parallelization> specify the parallelization for standard scrypt.
--block-size <blockSize> specify the block size (normally is 8) for standard scrypt.
--dk-len <dkLen> specify derived key length for standard scrypt.
--hash-input-order <hashInputOrder> specify the order of password and salt. Possible values are SALT_FIRST and PASSWORD_FIRST. MD5, SHA1, SHA256, SHA512, HMAC_MD5, HMAC_SHA1, HMAC_SHA256, HMAC_SHA512 support this flag.
-h, --help output usage information
推荐阅读
- qt - 为 QML QtQuick 创建一个测试项目
- laravel - 必须提供来源或客户。laravel 8 条支付网关
- php - 批准请假时扣除总假期
- code-coverage - 如何提高 CesiumJS 中的动态椭圆性能?
- python - 为什么列表项的地址相同?
- java - 执行函数时避免连续的“if (...)”检查
- r - 使用 `pivot_longer()` 和 `names_pattern` 时如何将后缀附加到 `.value`
- ruby-on-rails - 使用备用属性值修改或创建 paper_trail 版本
- google-oauth - 符合域验证要求
- mariadb - 产品变体价格查看表查询