I'm trying to validate a JWT that has been signed by a Certificate that is signed with a self signed root certificate. I was getting errors that I think were due to the lake of a CRL due to the root cert being self signed. I've implememnted the following to get around the issue but wanted to check that this code is still checking the chain and that the JWT is signed correctly against the certificate. Many Thanks
JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler();
X509ChainPolicy policy = new X509ChainPolicy
{
RevocationMode = X509RevocationMode.NoCheck
};
X509CertificateValidator certificateValidator = 509CertificateValidator.CreateChainTrustValidator(true, policy);
tokenHandler.CertificateValidator = certificateValidator;
var principle = tokenHandler.ValidateToken(jwtTokenString, validationParameters);