helpscout / helpscout-api-php

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

Confirming the webhook signature #296

Closed JosephGabito closed 2 years ago

JosephGabito commented 2 years 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 2 years 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 2 years ago

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

bkuhl commented 2 years 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 🤔 ...