Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有登录 UI 后生成的 Key cloak 令牌。我将此令牌传递给后端,即 nodeJS。在节点中,我想获取该用户的信息,例如用户角色、用户 ID。有没有任何模块或包呢?
npm install -save jsonwebtoken
var jwt = require('jsonwebtoken'); obj = jwt.decode(token);
obj 包含任何信息,如角色、用户 ID、...