dinding's recent timeline updates
dinding

dinding

V2EX member #350878, joined on 2018-09-20 10:14:53 +08:00
dinding's recent replies
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 存在一个地方。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2594 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 17ms · UTC 14:46 · PVG 22:46 · LAX 07:46 · JFK 10:46
♥ Do have faith in what you're doing.