如何在我的Flutter应用中实现Admin SDK,以便我可以从管理面板管理用户?

huangapple go评论62阅读模式
英文:

How do I implement Admin SDK in my flutter so that I should Manage the users from Admin Panel?

问题

我是新手,正在进行我的毕业项目,使用Flutter。我想在我的应用程序中实现管理员功能。到目前为止,我已经实现了数据流和身份验证部分,但我在实现用于从身份验证表中删除用户的管理员SDK方面遇到了困难,以便管理员具有完全的权限。

是否有其他可能的替代方法?还是我必须实现管理员SDK来完成这个任务。请指导一下?如果是的话,应该如何操作?

英文:

I'm new to flutter working on my Final Year Project. I want to implement Admin functionalities in my App. So far I had implemented the data flow and the authentication things but I am stuck at implementing the Admin SDK for the removal of users from the auth table so that the admin has the complete priviligies.

Is there any alternate way possible? Or I have to implement the Admin SDK for this. Kindly guide? And if yes how should I do so?

答案1

得分: 0

Firebase Admin SDK是设计用于受信任环境的,比如您的开发机器、您控制的服务器或云函数/Cloud Run。它们明确不应用于客户端应用程序,比如您的Flutter应用程序。

如果您想创建一个Flutter应用程序,用于管理用户,您可以:

  • 创建自己的API端点(例如,使用Cloud Functions或Cloud Run),在其中使用Admin SDK来实现必要的用例。
  • 保护这些端点,以便只有授权用户可以调用它们。
  • 然后从您的Flutter应用程序代码内部调用API端点。

另请参阅:

英文:

The Firebase Admin SDKs are designed to be used in a trusted environment, such as your development machine, a server that you control, or Cloud Functions/Cloud Run. They are explicitly not to be used in client-side applications, like your Flutter app.

If you want to create a Flutter app that can be used to manage users, you'll want to:

  • Create your own API end points (e.g. with Cloud Functions or Cloud Run) where you use the Admin SDK to implement the necessary use-cases.
  • Secure those end points so that only authorized users can call them,
  • Then call the API end points from within your Flutter application code.

Also see:

huangapple
  • 本文由 发表于 2023年2月9日 03:19:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75390737.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定