spatie / laravel-webhook-client

Receive webhooks in Laravel apps
https://freek.dev/1383-sending-and-receiving-webhooks-in-laravel-apps
MIT License
992 stars 146 forks source link

Using Postman to test webhook #68

Closed cbloss closed 4 years ago

cbloss commented 4 years ago

This really isn't an issue but more of a question that I have no idea where to turn to and google is failing me right now. I'm trying to use Postman to test my webhook on a Laravel application and I'm trying to get away with not setting up the webhook-server. I got the client all setup but I keep getting the error "signature is invalid" in Postman. I have the env set with a WEBHOOK_CLIENT_SECRET and the handler but everything else is set to the defaults of the config provided. I've tried quite a few different "authorization" options in Postman. I saw someone created a customed signature to get around it if the env is staging or local. I was trying to get away from that if I could.

I know this is out of scope of the package. I am just kind of not sure where to go for answers on this.

cbloss commented 4 years ago

I was able to figure it out by using the DefaultSignature and tweaking it. It looked like it was trying to compare the full request and not just the signature. Not sure if this is a good fix, but it works. Sorry about this!

Crowly34 commented 3 years ago

@cbloss if you don't want to tinker with the DefaultSignatureValidator (and still need this a year later) seems like it uses an HMAC/SHA-256, and this article explains pretty well how to configure your Postman to do exactly that.

mzahirr commented 1 year ago

@cbloss if you don't want to tinker with the DefaultSignatureValidator (and still need this a year later) seems like it uses an HMAC/SHA-256, and this article explains pretty well how to configure your Postman to do exactly that.

THANK YOU