Shopify / Shopify/shopify-app-template-php

Signature verification failed

Open
#408 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
340
Forks
108
PR merge metrics
No merged PRs in 30d

Description

Issue summary

I used the CLI, and successfully created an app using npm run dev and ngrok into the local install. However, once I deployed to production I ran into both a "CSRF token mismatch" and "Firebase\JWT\SignatureInvalidException: Signature verification failed" error.

In order to resolve the CSRF issue I removed the middleware, which probably isn't the best solution.

However, I'm stumped on how to resolve the JWT issue.

Expected behavior

After following the official Shopify tutorial and deploying to production, the application should work successfully.

Actual behavior

Production installs result in CSRF and JWT issues.

Steps to reproduce the problem

  1. Run Shopify CLI and use the PHP template.
  2. Deploy to production server using composer install and SHOPIFY_API_KEY=** npm run build
  3. Install the app to a test store using Test your app > Select store.

Reduced test case

Deploy the Shopify CLI PHP template.


Checklist

  • I have described this issue in a way that is actionable (if possible)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the production deployment steps using composer install and SHOPIFY_API_KEY=** npm run build, then inspect app/Http/Kernel.php and the reported CSRF and Firebase JWT errors. Reproduce the CLI template installation against a test store; done means the production app installs and operates without the CSRF token mismatch or signature verification failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.