【问题标题】:firebase_admin auth delete_user suddenly not working as expectedfirebase_admin auth delete_user 突然无法按预期工作
【发布时间】:2018-06-16 17:16:40
【问题描述】:

我有一段代码在很长一段时间内每天自动运行两次。在上周的某个时候,我一直使用的 auth.delete_user 方法开始失败,并返回错误。有谁知道发生了什么变化,或者我做错了什么? documentation 中似乎没有任何变化。

我得到的错误是:

Server response: {
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"local_id\": Proto field is not repeating, cannot start list.",
    "errors": [
      {
        "message": "Invalid JSON payload received. Unknown name \"local_id\": Proto field is not repeating, cannot start list.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

一个人为的代码示例是:

from firebase_admin import credentials
from firebase_admin import auth
from firebase_admin import db

try:
    cred = credentials.Certificate("serviceAccountKey.json")
    firebase_admin.initialize_app(cred, {
        'databaseURL': 'https://[project].firebaseio.com'
    })
except Exception as e:
    f.write(str(e.message))

uid = 'some valid UID string'
user = auth.delete_user(uid)

非常感谢您对出了什么问题的任何见解!

【问题讨论】:

    标签: firebase-authentication firebase-admin


    【解决方案1】:

    这个的底层实现实际上是不正确的。 这是fixed a while back

    您应该已经收到一封电子邮件来升级您的 python admin sdk 版本。 升级到最新版本应该可以解决此问题。

    【讨论】:

    • 嘿,感谢您指出这一点!我更新了本地环境,但设法忘记更新用于自动化的实例。问题解决了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-13
    • 2013-12-23
    • 2014-12-09
    • 2016-01-13
    • 2020-09-21
    • 2011-08-17
    • 2012-04-29
    相关资源
    最近更新 更多