Closed zurich-ah closed 2 years ago
Here are some tips for you to try and see if it helps
hi @shwetha-manvinkurke ,
I've reviewed the tips page you have provided. This is indeed the samples from where these tests were referenced. Please see the link in step 1 to reproduce.
The core issue is that, following the provided documentation, using a real event from Sendgrid, the provided test cases are not passing the transaction. (It then also obviously fails the real processing).
If you would like I am happy to share the real transaction information / test values.
To help eliminate human error, the reason we reused the existing test class provided by sendgrid-java libraries is that I've noted a lot of errors around processing the PAYLOAD object (with cr characters and what not).
However, simply replacing the other keys (public, private and timestamp) still yields an error return.
Hi,
I've found the root issues for both the test and core execution.
The verification method is extremely sensitive to whitespaces and format. As such, the supplied PAYLOAD when verifying is required to be a single line no spaced value.
As we were running this via a Mulesoft API the following code snippet for the payload has fixed this issue:
(write(payload,"text/json",indent:false) replace ": " with ":") ++ "\r\n"
Happy to close this issue now. Thanks.
Issue Summary
Reusing test cases with our own public key and event from Sendgrid yields different results. Please note; the values supplied in the organisation based keys have been taken from a real Sendgrid event and the public key retrieved via both the UI and calling https://api.sendgrid.com/v3/user/webhooks/event/settings/signed. I have raised a support ticket (7281978) with Sendgrid internal cases however they pointed us here.
Steps to Reproduce
Code Snippet