简体   繁体   English

JWT 可以用作我同时具有 spring 和节点微服务的应用程序的通用身份验证介质吗?

[英]Can JWT be used as a common authentication medium for a application where i have both spring and node microservices?

I have a Angular front end web app talking to both Spring and node microservices, while the spring microservice will handle user registration and sign in the node back-end will handle a lot of the post sign in activities. I have a Angular front end web app talking to both Spring and node microservices, while the spring microservice will handle user registration and sign in the node back-end will handle a lot of the post sign in activities. Can jwt be used as a medium to maintain authentication between all these sevices? jwt 可以用作维护所有这些服务之间的身份验证的媒介吗?

In shortly, Authentication is the process of recognizing the user.简而言之,身份验证是识别用户的过程。 Authorization is the user's privileges.You can use jwt in both process language-independent.授权是用户的权限。您可以在两个过程中使用 jwt 与语言无关。 When user log in using service written with java spring framework, service generates a jwt token.当用户使用使用 java spring 框架编写的服务登录时,服务会生成一个 jwt 令牌。 after that when the user calls the service written with java or nodejs, you can check user with jwt easily.之后,当用户调用用 java 或 nodejs 编写的服务时,您可以使用 jwt 轻松检查用户。

JWT is the way to exchange encoded token between services. JWT 是在服务之间交换编码令牌的方式。 Certainly JWT can be used to do all this but the questions should be how.当然 JWT 可以用来做这一切,但问题应该是如何做。

Say you have frontend that talks to identity service (Azure AD/ Auth0/ Okta/Your own) and get you the JWT token.假设您有与身份服务(Azure AD/Auth0/Okta/Your own)对话的前端,并获得 JWT 令牌。 Each request that talks to backend service (or inter services communication) will carry the token.每个与后端服务(或服务间通信)对话的请求都将携带令牌。 The backend service should be able to talk to identity provider and validate that token.后端服务应该能够与身份提供者对话并验证该令牌。

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

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