php-shopify icon indicating copy to clipboard operation
php-shopify copied to clipboard

Feature Request: Add/Restore signature validation in AuthHelper::verifyShopifyRequest()

Open kennypu opened this issue 3 years ago • 0 comments

Hello,

Context: I'm working on an embedded Shopify App, which utilizes the App Proxy feature for Shopify Apps. This will route requests such as example.myshopify.com/tools/myapp_api to your own server eg. example.com/api, with php-shopify running at /api.

For validation of these App Proxy requests, Shopify adds the following to the request GET (print of $_GET):

Array
(
    [shop] => example.myshopify.com
    [path_prefix] => /tools/myapp_api
    [timestamp] => 12345
    [signature] => 12345signature12345
)

I was looking to see if the sdk already provides a way to validate these but it looks like it's not there. In AuthHelper::verifyShopifyRequest(), it looks like signature verification was done before but removed.

For now I am verifying it with my own implementation, but it would be great to just use this function to verify requests.

Thanks

kennypu avatar Oct 02 '21 01:10 kennypu