dinding 最近的时间轴更新
dinding

dinding

V2EX 第 350878 号会员,加入于 2018-09-20 10:14:53 +08:00
dinding 最近回复了
2021-12-09 14:43:01 +08:00
回复了 nianyu 创建的主题 信息安全 关于 token 过期的疑惑,为什么需要 refresh token?
1 从权限上说,refresh token 是和授权服务器之间的凭证,access token 是和资源服务器之间的凭证。
2 从实现上,有效的 access token 可以有多个,但是 refresh token 只能有一个。所以前者可以实现为 self-contanined(包含了请求资源的所有信息),无需持久化存储;但后者必须存在某个地方。
3 从安全性上,为了防止泄漏,access token 一般不会有很长的有效期。这里,“泄漏”的方式,除了楼主说的 storage 外,还包括比如日志,非 https 的 cookie ,不可信的第三方等等。显然,经常使用的 access token, 要比不经常使用的 refresh token 泄漏的概率高。此外,refresh token 是要配合 client id/secret 一起使用的,通常 client id/secret 不会和 refresh token 存在一个地方。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2703 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 15:06 · PVG 23:06 · LAX 08:06 · JFK 11:06
Developed with CodeLauncher
♥ Do have faith in what you're doing.