helpscout / helpscout-api-php

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

Can't verify incoming webhooks #272

Closed miken32 closed 3 years ago

miken32 commented 3 years ago

Current behavior Signature mismatch: Expected signature is FLX317e8jkhTIjNkvivhXLbAY/E=. No signature was provided.

Expected behavior Signature match

Your API looks for headers HTTP_X_HELPSCOUT_SIGNATURE and X_HELPSCOUT_SIGNATURE. Neither of these are contained in the request object generated by Laravel using the nyholm/psr7 library.

  -headerNames: array:10 [
    "host" => "host"
    "user-agent" => "user-agent"
    "content-length" => "content-length"
    "accept" => "accept"
    "accept-encoding" => "accept-encoding"
    "content-type" => "content-type"
    "x-forwarded-for" => "x-forwarded-for"
    "x-forwarded-proto" => "x-forwarded-proto"
    "x-helpscout-event" => "x-helpscout-event"
    "x-helpscout-signature" => "x-helpscout-signature"
  ]

The code should be updated to look for x-helpscout-signature with hyphens in addition to underscores.

miken32 commented 3 years ago

Same for x-helpscout-event of course.

bkuhl commented 3 years ago

Thanks for sharing this, I'll submit a PR adding them.

bkuhl commented 3 years ago

This is now available in v3.5.1! Thanks for bringing this up