Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ internal static ValidationResult<SecurityKey> ValidateSignature(

if (key is not null)
{
jwtToken.SigningKey = key;

// If the key is found, validate the signature.
return ValidateSignatureWithKey(jwtToken, key, validationParameters, callContext);
}
Expand Down Expand Up @@ -314,7 +312,11 @@ private static ValidationResult<SecurityKey> ValidateSignatureWithKey(
ValidateSignature);

if (valid)
{
jsonWebToken.SigningKey = key;

return key;
}
else
return new SignatureValidationError(
new MessageDetail(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public void ValidateSignature(JsonWebTokenHandlerValidateSignatureTheoryData the

Exception exception = validationError.GetException();
theoryData.ExpectedException.ProcessException(exception, context);

if (jsonWebToken is not null)
Assert.Null(jsonWebToken.SigningKey);
}

TestUtilities.AssertFailIfErrors(context);
Expand Down
Loading