PHP example Stream Webhook Signature Validation

Can someone give me an PHP example of a Webhook Signature Validation, for the Stream API?

Essentially it is a hash (sha3) of the body and the secret Key?

I tried a couple of things like this:
$computedSignature = hash(‘sha3-256’, $request->getContent() . $signingSecret);

But nothing works.

Can someone help?

Hi @CryptoPaul at the moment we only have an example for javascript of python, maybe you can adapt it to PHP using a similar logic: https://docs.moralis.io/streams-api/evm/webhook-security#how-to-verify-the-signature-for-the-received-webhook-request

Hi. I found that…I tried every SHA also in PHP :slight_smile:
Can’t get it to work…unfortunately

I now get this error:

Moralis SDK Core Error: [C0006] Request failed, (400): Could not POST to https://my-local-host - Invalid cookie SameSite value. Please check your webhook URL.

Hi @CryptoPaul, can you please recheck your webhook url? this error generally indicates an issue with the webhook url provided, if you are having issues with your webhook, you can obtain one from this site to test - https://webhook.site/