【问题标题】:How to use Google relyingparty to disable user Firebase?如何使用 Google 依赖方禁用用户 Firebase?
【发布时间】:2017-01-09 19:40:54
【问题描述】:

我想从我的应用中禁用 Firebase 用户,但 Firebase 文档只允许我选择删除用户。

我认为解决方案就像创建用户前: https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=[YourKey]

但没有关于此的文档。

【问题讨论】:

    标签: firebase firebase-authentication


    【解决方案1】:

    Firebase Admin SDK 有一个禁用用户的选项。

    参见this the documentation,其中包含此代码示例:

    admin.auth().updateUser(uid, {
      email: "modifiedUser@example.com",
      emailVerified: true,
      password: "newPassword",
      displayName: "Jane Doe",
      photoURL: "http://www.example.com/12345678/photo.png",
      disabled: true
    })
      .then(function(userRecord) {
        console.log("Successfully updated user", userRecord.toJSON());
      })
      .catch(function(error) {
        console.log("Error updating user:", error);
      });
    

    【讨论】:

      猜你喜欢
      • 2019-09-14
      • 2019-08-02
      • 2020-06-02
      • 2017-11-01
      • 2016-09-06
      • 1970-01-01
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      相关资源
      最近更新 更多