Skip to content

Commit

Permalink
Adds the expected signature data to the SignatureVerificationExceptio…
Browse files Browse the repository at this point in the history
…n's data dictionary
  • Loading branch information
rpetz committed Nov 29, 2016
1 parent f6ac211 commit ccb9a5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/JWT/JWT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ public static void Verify(string payloadJson, string decodedCrypto, string decod
{
if (decodedCrypto != decodedSignature)
{
throw new SignatureVerificationException("Invalid signature");
var signatureVerificationException = new SignatureVerificationException("Invalid signature");
signatureVerificationException.Data.Add("Expected", decodedCrypto);
signatureVerificationException.Data.Add("Received", decodedSignature);
throw signatureVerificationException;
}

// verify exp claim https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.4
Expand Down

0 comments on commit ccb9a5e

Please sign in to comment.