JOSE4J将jwks_uri作为JWT验证的起点,我想知道是否有可能支持发现文档作为起点,JOSE4J将从那里获取jwks_uri,然后通过JWKS密钥文档选择与JWT具有匹配的公钥。通过这种方式,我只需在代码中硬编码发现文档uri,因为我有点担心jwks_uri是否会在没有通知的情况下更改,据我所知,熟悉的发现文档是固定的。
这就是它现在的工作方式:
// 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,并相应地进行操作。
谢谢!
1月
发布于 2017-06-09 21:48:38
没有对它的直接支持,但您可以使用该逻辑实现自己的VerificationKeyResolver (可能在内部使用HttpsJwksVerificationKeyResolver )。或者应用程序代码可以(定期)从发现文档中提取jwks_uri值,并使用它创建HttpsJwksVerificationKeyResolver。
https://stackoverflow.com/questions/44424242
复制相似问题