java - how to set 2 types of user for a certain app
问题描述
I wanna to create an app that has 2 types of users first type is admin: that has Authority to add info and manage the app second type is the customer and every one has a different options and screens now if I used firebase with specific login with facebook, it will offer only one type of user so how I can use the both types of users authinication ( where I begin to search ?? ) and if want to put an IF method in the code of the app ( if the admin input a specific password it will give him the access to the admin app , is this method dangerous or less security ?
解决方案
您正在寻找自定义声明
您可以分配给custom claims
用户帐户,然后您应该使用custom claims
文档中指定的帐户来区分该用户是否具有所需custom claims
的“权限”,以便执行该特定操作,无论是对 Firestore 还是对存储的读/写。
在应用程序中,您可以使用这些自定义声明来选择要为登录用户显示的 UI。
UI 本身应该只是一个骨架,您应该始终使用来自可信来源(服务器、firestore、存储、云功能)的数据填充 UI,以验证完整性,custom claims
因为恶意可以编辑您的代码以获取访问用户界面。
推荐阅读
- visual-studio-code - VSCode 中 JSX 标签内的片段
- python - 使用其他功能克隆 tkinter 按钮
- java - 检查数据库中密码的功能
- java - 如何在每行中添加 3 个按钮
- android - 2018 年有效地裁剪和缩放位图?
- async-await - 如何覆盖 C++ Cli 中的异步方法?
- ios - 如何在 iOS 中包含 SonarQube Analyzer 的 Pods 或 Frameworks 等依赖项项目
- opengl - 景深人工制品
- apl - 这个 APL 黄金比例代码是如何工作的?
- scala - scala在play框架中验证密码并确认密码