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

边栏推荐
- SQL intra statement operation
- Getting started with ffmpeg
- 51单片机_外部中断 与 定时/计数器中断
- FPGA的虚拟时钟如何使用?
- [teacher zhaoyuqiang] use the Oracle tracking file
- dhcp、tftp基础
- 1279_ Vsock installation failure resolution when VMware player installs VMware Tools
- Vulnhub target: boredhackerblog: social network
- Pipeline concept of graphic technology
- Swift Extension ChainLayout(UI的链式布局)(源码)
猜你喜欢

2021-03-04 COMP9021第六节课笔记

Leetcode 207: course schedule (topological sorting determines whether the loop is formed)

Écouter le réseau d'extension SWIFT (source)

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

Swift extension networkutil (network monitoring) (source code)

The first exposure of Alibaba cloud's native security panorama behind the only highest level in the whole domain

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

2022茶艺师(中级)上岗证题库及在线模拟考试

Screenshot recommendation - snipaste

一文理解同步FIFO
随机推荐
Auto usage example
Do you still have the opportunity to become a machine learning engineer without professional background?
Robot acceleration level task priority inverse kinematics
3D数学基础[十七] 平方反比定理
论文笔记: 多标签学习 DM2L
小样本故障诊断 - 注意力机制代码 - BiGRU代码解析实现
For a detailed explanation of flex:1, flex:1
Vscode topic recommendation
Leetcode 207: course schedule (topological sorting determines whether the loop is formed)
Swift Extension ChainLayout(UI的链式布局)(源码)
Qopengl display point cloud file
1279_VMWare Player安装VMWare Tools时VSock安装失败解决
Solution of electric education system for intelligent supervision station
Pagoda panel installation php7.2 installation phalcon3.3.2
Leetcode exercise - jumping game, combination summation
Question 1: the container that holds the most water
Future trends in automated testing
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
longhorn安装与使用
PAT 1157:校庆