gpt4 book ai didi

azure - alg 字段未显示在 Azure AD jwks 响应中

转载 作者:行者123 更新时间:2023-12-03 00:23:55 25 4
gpt4 key购买 nike

我使用 Azure AD 控制台配置 JWT token 。一切看起来都很好并且能够检索 token ,但我发现 JWKS_url ( https://login.microsoftonline.com/ {tenantId}/discovery/v2.0/keys) 的响应中不存在“alg”(算法)字段。请看下面的截图,所以我的程序不知道应该使用哪种算法来解码。我应该如何在控制台中进行配置,以便它像其他 IDP 一样返回 jwks 响应中每个键的 alg 字段?

JWKS response Screenshot

最佳答案

当您使用 Jwt.ms 解码收到的 JWT token 时您可以看到 header 提供有关所使用的算法(即 RS256)和所使用的 key ID 的信息,但这本身不足以找到要使用的 key 。

使用

查找用于验证签名的公钥
https://login.microsoftonline.com/{tenantId}/.well-known/openid-configuration

从此它指向获取属性 jwks_uri,它返回另一个 JSON 文档,其中列出了许多键,您可以在其中使用 JWT header 中的 kid 来识别要使用哪个键

关于azure - alg 字段未显示在 Azure AD jwks 响应中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62411205/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com