helpscout / helpscout-api-php

PHP Wrapper for the Help Scout API
MIT License
98 stars 62 forks source link

Confirming the webhook signature #296

Closed JosephGabito closed 1 year ago

JosephGabito commented 1 year ago

Good day!

In the webhook documentation: https://developer.helpscout.com/webhooks/

The signature's value is fetch using $signature = $_SERVER['X-HELPSCOUT-SIGNATURE']

However X-HELPSCOUT-SIGNATURE is not actually available in the $_SERVER, but HTTP_X_HELPSCOUT_SIGNATURE is.

HTTP_X_HELPSCOUT_SIGNATURE works.

Just wanted to confirm, if this is correct.

Thanks

miguelrs commented 1 year ago

Hey @JosephGabito!

Actually the header may change slightly depending on the HTTP libraries used, so we consider a few variants of the header, as you can see in the IncomingWebhook class, so either of them should work 👌

JosephGabito commented 1 year ago

Awesome. We're not using the SDK, but we'll give it a try. Thanks! 🙌

bkuhl commented 1 year ago

@JosephGabito There have been times in my career where I've opted to not use the provided SDK as well. If you're willing to share, I'd be curious what the circumstances are that drove the decision to not use the SDK? Maybe we could use this feedback to improve it 🤔 ...