-
Notifications
You must be signed in to change notification settings - Fork 386
webhook.process validation fails in custom apps #772
Comments
For a store-specific custom app (which I think you're referring to here), the |
I have used the |
We're having the same issue. @SuperKXT thank you for sharing your hack. I can confirm that when using the hack, everything works as expected. |
Same issue here. I initially tried passing a custom I spent half a day getting to this point, though. This issue seems like a major oversight. This is my first time using this library, so forgive me if I'm missing something. But I'm not sure how webhooks were validated with private apps in the past few years within this library since it's currently impossible to input the shared secret into the |
Add `adminApiAccessToken` parameter to `config` for when `isCustomStoreApp` is `true`. This is then used for authenticating API requests, instead of using `apiSecretKey` which was previously set to the Admin API access token for custom store apps. `apiSecretKey` must now be set to the custom store app's API secret key, which is used to validate the HMAC of webhook events received from Shopify for a custom store app. Fixes #772, #800
Add `adminApiAccessToken` parameter to `config` for when `isCustomStoreApp` is `true`. This is then used for authenticating API requests, instead of using `apiSecretKey` which was previously set to the Admin API access token for custom store apps. `apiSecretKey` must now be set to the custom store app's API secret key, which is used to validate the HMAC of webhook events received from Shopify for a custom store app. Fixes #772, #800
Add `adminApiAccessToken` parameter to `config` for when `isCustomStoreApp` is `true`. This is then used for authenticating API requests, instead of using `apiSecretKey` which was previously set to the Admin API access token for custom store apps. `apiSecretKey` must now be set to the custom store app's API secret key, which is used to validate the HMAC of webhook events received from Shopify for a custom store app. Fixes #772, #800
Add `adminApiAccessToken` parameter to `config` for when `isCustomStoreApp` is `true`. This is then used for authenticating API requests, instead of using `apiSecretKey` which was previously set to the Admin API access token for custom store apps. `apiSecretKey` must now be set to the custom store app's API secret key, which is used to validate the HMAC of webhook events received from Shopify for a custom store app. Fixes #772, #800
Issue summary
The HMAC sent in the HTTP webhook header validates against the passed
apiSecretKey
. In a custom app, the documentation indicates using the shared secret instead.This is the relevant line.
shopify-api-js/lib/webhooks/process.ts
Line 53 in 2e01ac6
@shopify/shopify-api
version: 6.2.0Expected behavior
webhook.process
should validate the HMAC correctlyActual behavior
webhook validation fails.
I'm side-stepping the issue by manually setting
apiSecretKey
to thesharedSecret
just before validation. This works but feels like an unnecessary hack.The text was updated successfully, but these errors were encountered: