JWT 令牌:注销 JWT 令牌 [英] JWT Token: logout JWT token

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

问题描述

目前我们使用 JWT 进行身份验证,因此一旦创建令牌,它就是终身的,如果我们设置时间过期,令牌将过期.有什么办法可以使令牌过期吗?单击注销按钮时,我需要销毁令牌.asp.net 核心,web api.

for authentication currently we are using JWT so once token created it's for lifetime and if we set time expire, the token will expire. is there any way to expire token ? while clicking log out button i need to destroy the token. asp.net core , web api.

推荐答案

我认为取消 JWT 是处理注销的最佳方式,Piotr 在他的博客中解释得很好.在此处输入链接描述取消 JWT 令牌

i think cancelling JWT is best way to handle logout , Piotr explained well in his blog. enter link description here Cancel JWT tokens

这篇关于JWT 令牌:注销 JWT 令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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