从Web应用程序中删除经过Firebase身份验证的用户 [英] delete firebase authenticated user from web application

查看:48
本文介绍了从Web应用程序中删除经过Firebase身份验证的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加选项以从Firebase经过身份验证的用户列表中删除A用户-从我的Web应用程序中.我使用的身份验证方法是电子邮件和密码身份验证.

I want to add the option to remove A user from firebase authenticated Users list - from my web application. The authentication method I used is email and password authentication.

该应用程序是基于js/html/css文件的移动单页应用程序(浏览器应用程序).

the application is mobile single page application, based on js/html/css files (browser application).

  1. 我可以使用firebase Admin SDK删除A用户吗?
  2. 还有更好的方法吗?最佳做法是什么?

谢谢迈克尔.

推荐答案

可以使用Firebase Admin SDK删除用户.

The Firebase Admin SDK can be used to delete a user.

但是它只能在受信任的环境中使用,因为它可以完全访问您项目中的大多数Firebase服务.典型的受信任环境是:您控制的服务器或Firebase的Cloud Functions.

But it should only be used in trusted environments, since it allows full access to most of the Firebase services in your project. Typical trusted environments are: a server you control, or Cloud Functions for Firebase.

因此,执行此操作的一种常见方法是构建一个Cloud Function,该功能删除用户(使用Admin SDK),然后从您的Web应用程序中调用该功能.您将必须确保只有受信任的用户才能调用该功能,通常通过对照已知的受信任用户列表检查其UID或电子邮件地址来实现.

So a common way to do this is to build a Cloud Function that deletes the user (using the Admin SDK) and then call that function from your web app. You will have to ensure that only trusted users can call the functionality then, typically by checking their UID or email address against a known list of trusted users.

这篇关于从Web应用程序中删除经过Firebase身份验证的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆