在多个服务中处理JWT令牌 [英] Handling JWT token in multiple services

查看:86
本文介绍了在多个服务中处理JWT令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个可以访问少量其余API的系统上工作,我们使用基于JWT toke的身份验证.是否可以在所有服务中使用相同的令牌?如果是,如何

I'm working on a system where it access few rest APIs and we use JWT toke based authentication. Is it possible to use same token across all services ? If yes, how

推荐答案

只要服务使用相同的令牌提供者来验证令牌,便可以在不同的服务中使用令牌(我的意思是已用").

Token can be used (by "used", I mean consumed) across different services as long as they use the same token provider to validate the token.

实际上,出于安全目的,令牌应该是短命的.因此,实际上,您将只使用一次性令牌来建立用户会话.并且根据用户会话,您将相应地进行不同的服务处理.

In fact, token is supposed to be short-lived for security purpose. So in real, you will just use one-time token to establish the user session. And based on the user session, you will do different service handling accordingly.

让我知道这是否合理.

这篇关于在多个服务中处理JWT令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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