Hello,
I’m trying to build my first app (not embedded) using Node.js and Express ,and I’m stuck at the OAuth install step. I’ve been getting the error:
Oauth error invalid_request: The redirect_uri and application url must have matching hosts
Here’s what I’ve already done:
- My app is hosted locally and exposed using ngrok (
https:/<my-ngrok-subdomain>.ngrok-free.app
)
- I’ve set the following in the App Setup page:
- App URL:
https://<my-ngrok-subdomain>.ngrok-free.app
- Allowed redirection URL:
<my-ngrok-subdomain>.ngrok-free.app/auth/callback
- When I visit the install link in an incognito browser, I get the same error and Shopify never reaches my
/auth/callback
route (no code
, hmac
, or timestamp
are sent).
- My app is not yet installed in any store.
My goal is just to complete the OAuth flow and get an access token. Any ideas on why this error keeps happening or what I might still be missing?
1 Like
Hey @user162,
Thanks for sharing the details here. From what you’ve explained your setup seems correct although I do see you’re missing the https://
from your redirect URL so that could be the issue.
If that doesn’t fix it, I have seen in the past where ngrok free tunnels can cause issues with authentication so I would suggest testing with another service like cloudflare to see if you get the same error.
Hey @KyleG-Shopify,
Thanks for the advice. I added the missing https:// and switched to cloudflare and am unfortunately running into the same problem. Any further advice or helpful resources would be appreciated!
That’s interesting.
Can you share more about how you are installing the app and where the URL is coming from? IE is this a custom app or a public app?
If it’s a custom app, then make sure you’re using the install link provided in the partner dashboard and that the app isn’t already installed on a non-development store.
If it’s a public app, try initiating the installation directly from the link your partner dashboard to install on a development store.
Hey @user162 Are you still experiencing this issue, or can I mark this as solved?
Hey @KyleG-Shopify, I was able to resolve the issue, feel free to mark as solved!
1 Like