php-shopify
php-shopify copied to clipboard
md5($realHmac) === md5($hmac) always returns false
Hello!
I have a Shopify Custom App and i'm trying to use this library for authentication. Whenever i reach AuthHelper->verifyShopifyRequest() it's always comparing two different values and it will fail with error "This request is not initiated from a valid shopify shop!"
//hash the values before comparing (to prevent time attack)
if(md5($realHmac) === md5($hmac)) {
Would appreciate some help. Thanks!
I had a similar issue and it was actually due to my friendly URLs. A parameter of "file" was passed into every page, but using htaccess hidden. I needed to update the "buildQueryString" function in the AuthHelper.php file to exclude this parameter. Do some debugging and check what URL buildQueryString is retruning to see if it matches yours.