Missing 'alg' in jwtSecurityToken header

29 Views Asked by At

When i am going to validate jwt token not decode not returning 'alg' and always invalidated the token validation. By default Validating in System.IdentityModel.Tokens.Jwt

Exception:

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.

enter image description here

enter image description here

1

There are 1 best solutions below

0
shaair On

I had updated the package System.IdentityModel.Tokens.Jwt from 7.2.0 to 7.4.1 and it works.