知识卡片

普通读书笔记卡 · 3273.a

公开客户端用授权码加PKCE

理解等级:高级

浏览器或移动端应用难以保守客户端密钥。授权码流程加入 PKCE 后,客户端先提交随机校验值的变换结果,换令牌时再出示原值,让截获授权码者难以单凭该码换取令牌。具体流程和参数应按当前标准实现。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      The code_verifier is a cryptographically random string generated by the client, and the code_challenge is the hashed value of the code_verifier. When the client application initiates the request to the authorization server, it sends the code_challenge, and when an access token is requested, the authorization code is presented along with the code_verifier.

    参考来源

    - 位置:《Mastering API Architecture》第7章《API Authentication and Authorization》之《Authorization Code Grant》(源文件:_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文比较保密客户端与公开客户端,说明 PKCE 使用 code_challenge 和 code_verifier 绑定授权请求与令牌请求,减少授权码截获风险。 - 原始内容:The code_verifier is a cryptographically random string generated by the client, and the code_challenge is the hashed value of the code_verifier . When the client application initiates the request to the authorization server, it sends the code_challenge , and when an access token is requested, the authorization code is presented along with the code_verifier .