“孩子"是什么意思?在 JWT 令牌中声明? [英] What's the meaning of the "kid" claim in a JWT token?
问题描述
我生成了一个 JWT,其中有一些我很理解的声明,但是标题中有一个名为 kid
的声明.有谁知道是什么意思吗?
I generated a JWT and there are some claims which I understand well, but there is a claim called kid
in header. Does anyone know what it means?
我使用 auth0.com 生成了令牌
I generated the token using auth0.com
推荐答案
kid
是一个可选的标头声明,它包含一个密钥标识符,当您有多个密钥来签署令牌并且您需要查找正确的以验证签名.
kid
is an optional header claim which holds a key identifier, particularly useful when you have multiple keys to sign the tokens and you need to look up the right one to verify the signature.
一旦签名的 JWT 是 JWS,请考虑 RFC 7515 中的定义:
Once a signed JWT is a JWS, consider the definition from the RFC 7515:
kid
(key ID) Header Parameter 是一个提示,指示哪个键用于保护 JWS.此参数允许发起人明确地向接收者发出密钥更改的信号.的结构kid
值未指定.它的值必须区分大小写细绳.此标头参数的使用是可选的.
The kid
(key ID) Header Parameter is a hint indicating which key
was used to secure the JWS. This parameter allows originators to
explicitly signal a change of key to recipients. The structure of the
kid
value is unspecified. Its value MUST be a case-sensitive
string. Use of this Header Parameter is OPTIONAL.
与 JWK 一起使用时,kid
值用于匹配 JWK kid
参数值.
When used with a JWK, the kid
value is used to match a JWK kid
parameter value.
这篇关于“孩子"是什么意思?在 JWT 令牌中声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!