【问题标题】:What is the recommended way of deleting a user account from Google Identity Toolkit (Gitkit)?从 Google Identity Toolkit (Gitkit) 中删除用户帐户的推荐方法是什么?
【发布时间】:2015-11-23 05:58:19
【问题描述】:

我没有在文档中找到有关从 Gitkit 数据库中删除用户帐户的指导。我计划创建一些基于不同提供商的测试帐户以及一些基于密码的帐户。清除所有这些测试帐户的最佳方法是什么?

【问题讨论】:

    标签: java user-accounts google-identity-toolkit


    【解决方案1】:

    Google Identity Toolkit Java client library 提供deleteUser() 方法来删​​除单个用户帐户:

    GitkitClient gitkitClient = GitkitClient.newBuilder()
          .setGoogleClientId("your-oauth2-web-client-id-at-Google")
          .setServiceAccountEmail("your-service-account-email-at-Google-developer-console")
          .setKeyStream(new FileInputStream("path-to-your-service-account-private-file"))
          .build();
    gitkitClient.deleteUser("test-user-id");
    

    您可能需要创建一个测试项目来尝试删除(和其他操作),因为已删除的帐户无法恢复。

    【讨论】:

    • 谢谢!是的,我最终在 GitkitClient 可用的方法中找到了它。
    猜你喜欢
    • 1970-01-01
    • 2012-02-27
    • 2021-08-30
    • 2012-10-12
    • 2011-05-30
    • 2019-04-23
    • 2011-02-14
    相关资源
    最近更新 更多