知识卡片

普通读书笔记卡 · 3277

权限范围只定义粗粒度边界

理解等级:高级

OAuth scope 表达客户端获准访问的一类 API 或动作,例如读取与修改分开,适合让用户理解并同意。它通常是粗粒度边界,不能替代资源服务对具体对象、功能和用户自身权限的检查。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Scopes don’t have a defined standard, however they are typically used as a coarse-grained separation within an API. Scopes must make sense to the end user, as they are going to need to consent to their usage. Once the resource owner grants authorization to a resource, this information needs to be used by the resource server to enforce this.

    参考来源

    - 位置:《Mastering API Architecture》第7章《API Authentication and Authorization》之《OAuth2 Scopes》《Authorization Enforcement》(源文件:_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以 AttendeeRead 与 AttendeeAccount 区分操作,说明 scope 粗粒度,并明确用户本人无权执行的操作不能因客户端获 scope 就放行。 - 原始内容:Scopes don’t have a defined standard, however they are typically used as a coarse-grained separation within an API. Scopes must make sense to the end user, as they are going to need to consent to their usage. Once the resource owner grants authorization to a resource, this information needs to be used by the resource server to enforce this.