Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
363 stars 107 forks source link

issue 'Unable to verify signature.' where the HMAC signature sent by Shopify during authentication suddenly does not match #295

Closed techbin closed 2 months ago

techbin commented 5 months ago

For bug reporting only! If you're posting a feature request or discussion, please ignore.

I'm relatively new to app development and currently working on creating a Shopify app using Laravel 11. I've encountered an issue 'Unable to verify signature.' where the HMAC signature sent by Shopify during authentication suddenly does not match.

Despite attempting various troubleshooting steps such as clearing browser cache, installing on new stores, and verifying API and secret keys, I'm still facing this issue.

Expected Behavior

Verify the signature & add the stores in the db and show the dashboard and allow billing

Current Behavior

The system was working fine (Laravel 8.75 and laravel-shopify:17.4.3) and I was getting 'Unable to verify signature.' for only the "old stores" which was fine for me but after adding billing (enabled shopify payments and test gateways) - further made some transactions that failed. All the links in the app started having an issue. Unsure if this is an issue with Shopify or something else.

Steps to Reproduce

Initially the system was Laravel 8.75 and "kyon147/laravel-shopify": "17.4.3" after started getting "Unable to verify signature." I upgraded my system to below configuration but the issue still exists.

Please provide detailed steps for reproducing the issue.

  1. Install Laravel: 11
  2. Install laravel-shopify: 21.0
  3. Follow installation steps and access any route link

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here. ` //Unable to verify signature. Osiset \ ShopifyApp \ Http \ Middleware \ VerifyShopify : 96 handle // Verify the HMAC (if available)

    $hmacResult = $this->verifyHmac($request);

    if ($hmacResult === false) {

        // Invalid HMAC

        throw new SignatureVerificationException('Unable to verify signature.'); **** Error ****

    }

`

Screenshot from 2024-04-09 10-12-38

fredchan179 commented 4 months ago

I got the same issue recently :(

HiteshPrivate commented 4 months ago

add your credentials in .env file SHOPIFY_API_KEY SHOPIFY_API_SECRET

It's not the bug.

Kyon147 commented 2 months ago

Closing as solution provided by @HiteshPrivate