当前位置:网站首页>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

边栏推荐
- Swift extension chainlayout (UI chain layout) (source code)
- 51单片机_外部中断 与 定时/计数器中断
- PAT 1157:校庆
- Chapter 1 overview of canvas
- Easyplayerpro win configuration full screen mode can not be full screen why
- Graphmae - - lecture rapide des documents
- Svn actual measurement common operation record operation
- 1279_VMWare Player安装VMWare Tools时VSock安装失败解决
- 2022年制冷与空调设备运行操作上岗证题库及模拟考试
- Auto usage example
猜你喜欢

The monthly salary of two years after graduation is 36K. It's not difficult to say

longhorn安装与使用

Simple summary of lighting usage

1279_ Vsock installation failure resolution when VMware player installs VMware Tools

Latest news of awtk: new usage of grid control

1-4metaploitable2 introduction

Swift Extension NetworkUtil(網絡監聽)(源碼)

Utilisation de la fermeture / bloc de base SWIFT (source)

C语言_字符串与指针的爱恨情仇

Examples of corpus data processing cases (reading multiple text files, reading multiple files specified under a folder, decoding errors, reading multiple subfolder text, batch renaming of multiple fil
随机推荐
Solution of electric education system for intelligent supervision station
Graphmae - - lecture rapide des documents
Vulnhub target: boredhackerblog: social network
软件工程导论——第三章——需求分析
longhorn安装与使用
Getting started with ffmpeg
Easyplayerpro win configuration full screen mode can not be full screen why
Industrial computer anti cracking
Phonics
LINQ 查询(2)
问题3 — messageBox弹框,修改默认背景色
SQL intra statement operation
dhcp、tftp基础
[nilm] non intrusive load decomposition module nilmtk installation tutorial
不止于观测|阿里云可观测套件正式发布
Do you still have the opportunity to become a machine learning engineer without professional background?
Methods of vector operation and coordinate transformation
Optimization and practice of Tencent cloud EMR for cloud native containerization based on yarn
[test development] first knowledge of software testing
From jsonpath and XPath to spl