We have encountered an issue during the app submission process.
When a user clicks Install App, our app correctly receives the OAuth callback URL and completes the Shopify OAuth authentication process. However, we recently received a notification stating:
“During an automated check, your app didn’t successfully initiate authentication when installing. The app responded with an unexpected URL.”
From our understanding, the expected URL belongs to Shopify’s admin domain, and it is not under our control. Therefore, the redirection after installation should be handled by Shopify itself, not by our app.
Could you please clarify the correct flow and expected URL redirections during the installation and OAuth process? We want to ensure we follow the correct OAuth flow and comply with Shopify’s installation requirements.
To summarize our current process:
User clicks Install App on Shopify.
Shopify initiates OAuth and redirects to our app’s callback URL.
Our app receives the code and exchanges it for the access token.
After successful authentication, our app redirects the user to our own login page (https://app.shiplogix.in/auth/login).
Please confirm if this flow is correct, or if we should redirect the user back to the Shopify admin URL or another URL to pass the automated check.
No we do not have an embedded app. It has a sapreate website on which user will redirect after installing the app in their store. The user journey is working fine but in app requirements it’s showing the expected url is different from the received url. please guide.
Thanks, Kyle. I really appreciate your help. This document was very helpful—I realized I had missed registering the install API in the App URL section of my Shopify app configuration.
We’re also running into an issue here on the same automated check for our standalone app:
Expected URL: https://admin.shopify.com/store/uvszh1-m5/app/grant
Actual URL: {our_app_url}/shopify/begin?hmac=<hmac>&host=<host>&shop=uvszh1-m5.myshopify.com×tamp=<timestamp>
I’ve already added this route to our App’s Settings > Build > Configuration > App URL:
{our_app_url}/shopify/begin
When installing our app though the Shopify Partners (i.e. click ‘Install app’ on the ‘Test app on development store’ page) everything works well:
User is routed to /shopify/begin
User is directed back to shopify to accept installation
User is routed to /shopify/callback
User is routed to another route within our app
Given that this all works properly as an actual user, at what step is the automated check getting stuck? The only thing I could think of is that instead of doing 3xx redirects, we do redirects via window.location.href = <redirect_url> because of some NextJS idiosyncracies
is where the user is redirected to after visiting /shopify/begin on our site.
To be specific, the frontend captures the query params on route /shopify/begin, then sends an HTTP request to our backend. The backend then does all of the verification steps and builds the redirect url (the one you sent) with the proper information filled in (most importantly, the shop, since the client_id, scope, redirect_uri, and access_mode are the same across shops). The backend sends this a 200 response with { redirectUrl: <redirect_url> } object as the response data. The frontend then takes this response data and sets window.location.href = <redirect_url>
Seems like this should be a GET request directly to our backend?