JWT令牌验证报错:缺失'alg'字段,签名验证失败(System.IdentityModel.Tokens.Jwt)
使用System.IdentityModel.Tokens.Jwt验证JWT令牌时验证失败问题
我在使用System.IdentityModel.Tokens.Jwt验证JWT令牌时,发现令牌未返回alg字段,导致令牌始终验证失败。抛出的异常信息如下:
IDX10503: Signature validation failed. Token does not have a kid. Keys tried: 'Microsoft.IdentityModel.Tokens.RsaSecurityKey, KeyId: '', InternalId: 'Y-aoLdlxdepu_g1odJVOn_g-FlaitSghcGfrV1vSuxg'. , KeyId: '. Number of keys in TokenValidationParameters: '0'. Number of keys in Configuration: '0'. Exceptions caught: 'Microsoft.IdentityModel.Tokens.SecurityTokenInvalidAlgorithmException: IDX10696: The algorithm 'Null' is not in the user-defined accepted list of algorithms.
相关截图:
内容的提问来源于stack exchange,提问作者shaair
相关产品推荐
相关产品推荐

