知识卡片
登录成功仍需资源级授权
令牌有效只证明请求通过了身份或粗粒度访问检查;读取订单等用户资源时,还要核对资源所有者是否与令牌对应。查询与修改应同时纳入所有权条件,防止一个已登录用户访问别人的对象。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 11 章《API authorization and authentication》(源文件:_epub-src/OEBPS/Text/11.htm)
- 结论依据:原文在令牌验证成功后继续检查订单只由下单用户访问,说明资源级授权是独立步骤。
- 原始内容:Now we must ensure that the details of each order are only accessible to the user who placed it; we don’t want to allow users to access each other’s data.