【发布时间】:2017-11-09 11:47:22
【问题描述】:
JOSE4J 以 jwks_uri 作为 JWT 验证的起点,我想知道是否可以支持 Discovery Document 作为起点,JOSE4J 会从那里获取 jwks_uri,然后去 JWKS 关键文档进行选择与 JWT 匹配的公钥通过孩子获得。这样我只需要在我的代码中硬编码发现文档 uri,因为我有点担心 jwks_uri 是否会在没有通知的情况下更改,据我所知,wellknow 发现文档是固定的。
现在是这样的:
// The HttpsJwksVerificationKeyResolver uses JWKs obtained from the HttpsJwks and will select the
// most appropriate one to use for verification based on the Key ID and other factors provided
// in the header of the JWS/JWT.
HttpsJwksVerificationKeyResolver httpsJwksKeyResolver =
new HttpsJwksVerificationKeyResolver(https_jwks);
也许让解析器识别是否传入发现文档 uri 并做出相应的行为会很好。
谢谢!
一月
【问题讨论】: