skip to Main Content

I created an embedded Shopify app and i am trying to run it on localhost.

When i install it on http://www.localhost:3000/login
enter image description here it redirects me to the admin panel even though i set my redirect link to http://localhost:3000/auth/shopify/callback

I want to know how i can get it working locally.

2

Answers


  1. You should use a service like:

    • Forward (EDIT: Forward has shutdown as of Jan 1, 2020)
    • Ngrok

    Those services allow you to have a url on internet that creates a tunnel to your localhost so you can test your webhooks, embedded pages and proxy pages with Shopify.

    You have to configure the url that the service you choose gives to you on your Shopify App using the Shopify Partner portal.

    I personally use Forward. With this service you get a domain like yourname.fwd.wf so you can have https://youname.fwd.wf/auth/shopify/callback and it will create a tunnel to your localhost.

    Login or Signup to reply.
  2. you can achieve that without using ngrok-like service with the combination of a proxi and a fake dns record.

    1. add fake domin in the System32driversetchosts file like this:

      127.0.0.1 www.<your fake domain>.com

    2. run local proxy service like npm local-ssl-proxy:

      local-ssl-proxy --source 443 --target 3000

    3. whitelist your fake domain in the Shopify app settings.
      enter image description here

    4. add Env variable in the env file:

      NODE_TLS_REJECT_UNAUTHORIZED=0

    the above worked for me with a Shopify AppProvider

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search