是否可以通过用户的UID从FirebaseAuth中删除用户? [英] Is there a way to delete a user from FirebaseAuth by their UID?

查看:53
本文介绍了是否可以通过用户的UID从FirebaseAuth中删除用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以通过用户的UID从FirebaseAuth中删除用户。根据我的在线研究,似乎您只能删除当前登录的用户。

I was wondering if there was a way to delete a user from FirebaseAuth by their UID. Upon my research online, it seems like you can only delete the current logged in user.

请告知是否可能。

推荐答案

登录的用户只能删除自己的帐户。无论使用哪种平台,任何用户都没有能力或权限从您的客户端Web或移动应用程序中删除另一个帐户。实际上,这将是一个巨大的安全漏洞。

A user signed in can only delete their own account. No user has ability or permission to delete another account from your client web or mobile app, not matter what platform. That would actually be a huge security hole.

您可以做的是使用 Firebase管理SDK ,它具有管理用户。特权后端代码可以通过UID删除任何用户。如果您打算让最终用户在后端调用某些功能以删除另一个用户,则应在后端代码中验证该用户应具有此特权。

What you can do instead is delete the user from a backend you control using the Firebase Admin SDK, which has the ability to manage users. Privileged backend code can delete any user by UID. If you intend for your end users to invoke some function on your backend that deletes another user, you should verify in your backend code that the user should have this privilege.

这篇关于是否可以通过用户的UID从FirebaseAuth中删除用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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