知识卡片

普通读书笔记卡 · 3514.d

令牌kid选择对应验签公钥

理解等级:中级

验证签名时可从 JWT 头部读取 kid,在可信发行方的 JWKS 中寻找对应公钥,再用服务端允许的算法验签。kid 只用于选候选密钥,未经验证的头部算法和密钥地址不能成为信任策略。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》附录 C《API authorization using an identity provider》(源文件:_epub-src/OEBPS/Text/C.htm) - 结论依据:原文说明 kid 匹配公钥集中的密钥;示例却信任未验证的 alg,故卡片明确把算法限制留在服务端。 - 原始内容:kid is the ID of the key, and we use it to match the kid field of the JWT’s header section. It tells us which key we need to use to verify the token’s signature. The x5c field contains an array of public keys in the form of