Azure AD-B2C 错误:IDX10501:签名验证失败。无法匹配键:kid: '[PII is hidden]',令牌:'[PII is hidden]'

Rum*_*uha 4 oauth-2.0 openid-connect azure-ad-b2c

我正在使用 Swagger 进行 API 调用,为了进行身份验证,我能够生成不记名令牌,但之后我收到 401 响应。检查日志后,错误如下:

Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10501: Signature validation failed. Unable to match keys: 
kid: '[PII is hidden]', 
token: '[PII is hidden]'
Run Code Online (Sandbox Code Playgroud)

我的 ConfigureAuth 方法如下:

Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10501: Signature validation failed. Unable to match keys: 
kid: '[PII is hidden]', 
token: '[PII is hidden]'
Run Code Online (Sandbox Code Playgroud)

Dre*_*ing 6

我不得不将我的 OpenIdConnectAuthenticationOptions.MetadataAddress 更新为 https://login.microsoftonline.com/tfp/{tenantId}/{policyId}/v2.0/.well-known/openid-configuration


Rum*_*uha 5

我能够通过传递正确的元数据端点来验证令牌。*

https://login.microsoftonline.com/tfp/ {0}/{1}/v2.0/.well-known/openid-configuration

*

  • 嗨,抱歉,我没有在某些网页上看到这一点,我团队中的安全顾问发现了这一点。 (2认同)