当前位置:网站首页>jwt(json web token)
jwt(json web token)
2022-06-24 06:57:00 【xcrj】
作用
jwt可用于跨域认证
构成
简介
- jwt全称json web token
- jwt由header.payload.signature组成
构成/header
{
"alg": "HS256",
"typ": "JWT"
}
构成/payload
常用负载:可选
- iss(issue JWT的签发者)
- aud(auditor JWT接收者)
- sub(subject,主题)
- iat(issued at,签发时间)
- exp(expire,到期时间)
- uid(用户ID)
- username(用户名)
- scopes(授权范围)
{
"iat": 1593955943,
"exp": 1593955973,
"uid": 10,
"username": "test",
"scopes": [ "admin", "user" ]
}
构成/signature
// header,中指定算法对JWT进行签名,secret秘钥
// secret,加密算法秘钥
signature=HMACSHA256(base64UrlEncode(header) + "." +base64UrlEncode(payload),secret)
流程
注意:
- token过期之后才会使用refresh_token
- refresh_token未过期只会生成新的token,不会生成refresh_token
- refresh_token过期之后只能重新登录
- 可以只使用token不适用refresh_token

边栏推荐
- 51单片机_外部中断 与 定时/计数器中断
- How to use the virtual clock of FPGA?
- SQL intra statement operation
- From jsonpath and XPath to spl
- Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
- OC extension detects whether an app is installed on the mobile phone (source code)
- Ad-gcl:advantageous graph augmentation to improve graph contractual learning
- More appropriate development mode under epidemic situation
- dhcp、tftp基础
- 2021-03-04 COMP9021第六节课笔记
猜你喜欢
随机推荐
"Adobe international certification" about Adobe Photoshop, creating and modifying brush tutorials?
Simple refraction effect
4-operation list (loop structure)
12--合并两个有序链表
Vscode topic recommendation
decltype用法介绍
5g industrial router Gigabit high speed low delay
Solve the problem of notebook keyboard disabling failure
[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA
【毕业季】你好陌生人,这是一封粉色信笺
搜索与推荐那些事儿
dhcp、tftp基础
Blue Bridge Cup_ Queen n problem
Swift extension chainlayout (UI chain layout) (source code)
FPGA的虚拟时钟如何使用?
Learning event binding of 3D visualization from scratch
LabVIEW查找n个元素数组中的质数
Latest news of awtk: new usage of grid control
1279_ Vsock installation failure resolution when VMware player installs VMware Tools
Upgrade Mysql to the latest version (mysql8.0.25)









