简体   繁体   English

Node.js多重认证

[英]Nodejs multiple authentication

Iam building a School Management web application and wanted to include multiple authentication. Iam正在构建学校管理Web应用程序,并希望包括多重身份验证。

My idea is first to authenticate the school and then the users such as admin,teacher and staff of that particular school. 我的想法是首先对学校进行身份验证,然后对特定学校的用户(例如管理员,老师和职员)进行身份验证。

Is there any way to implement this using nodejs and express. 有什么方法可以使用nodejs和express来实现。 By the way I have used passport to authenticate a user already (without school authentication) and want to build upon that. 顺便说一句,我已经使用护照来认证用户(没有学校认证),并且希望以此为基础。

Am I wrong to think of having multiple nested authentication? 考虑多重嵌套身份验证我是否做错了? And how would I go about implementing if possible? 如果可能的话,我将如何实施?

Multiple authentication is redundant. 多重身份验证是多余的。 You can use single authentication and role based access to ensure right resources are accessed by right person. 您可以使用单一身份验证和基于角色的访问来确保正确的人可以访问正确的资源。

In your case no need to authenticate a school. 在您的情况下,无需认证学校。 Just authenticate the user, check which school the user belongs and allow access to those resources. 只需对用户进行身份验证,检查用户所属的学校并允许访问这些资源即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM