立即在安装后验证身份,验证后立即重定向到应用 ui 检测不通过

我是非嵌入式应用,我的流程是这样的
Shopify → /auth (302)
/auth → Shopify OAuth授权页面 (303)
授权页面 → /auth/callback (302)
/auth/callback → 我应用的主页 (200)

按道理来说应该没问题的呀,为什么一直检测不通过呢,这两项:
立即在安装后验证身份,验证后立即重定向到应用 UI

里面的报错说明是:
在自动检查期间,您的应用未成功启动安装时身份验证。应用响应时提供了一个非预期的 URL。详细了解安装要求。

预期 URL:https://admin.shopify.com/store/uvszh1-m5/app/grant
实际 URL:https://a32333127.ngrok-free.app/auth?hmac=28e28bdc4d22a3f6eca2b62011990d5b&host=YWRtaW3RvcmgxLW01&shop=uvszh1-m5.myshopify.com&timestamp=1758436320

关键是我必须经过这一步/auth 才能获取Shopify OAuth授权页面呀,所以我不明白为什么这一步不让通过呢,或者我应该怎么改才能通过

Hi @user201,

我将使用翻译软件来回答,不过接下来您是否可以接受我们用英文提供支持?如果需要专门的普通话支持,建议您直接通过 Help Center 联系 Shopify 支持。

针对您收到的错误,预期 URL 指向您 Shopify 商店的后台(admin)地址

  • Expected URL: https://admin.shopify.com/store/uvszh1-m5/app/grant

这表明您在应用配置中直接设置了这个 admin 地址,具体是在 shopify.app.toml 配置文件中。

实际 URL 看起来是一个 Ngrok 隧道域名。您可以将此类隧道用作用于身份验证的 App URL,但需要在应用的 toml 配置文件中进行设置,并部署应用以确保更新后的配置和应用 URL 生效。

以下是关于 Shopify 应用配置,以及通过部署来更新配置的文档。

如果您能确认应用配置在 app_url 字段中已设置正确的非 admin URL,请告知发生此问题的应用名称,我们可以进一步协助排查。


Sharing the translated question, and my response in English in case anyone else is experiencing a similar error.


Translated Question:

I’m a non-embedded app, and my flow is like this:
Shopify → /auth (302)
/auth → Shopify OAuth authorization page (303)
Authorization page → /auth/callback (302)
/auth/callback → my app’s home page (200)

In theory this should be fine, so why does it keep failing the checks for these two items:
Authenticate immediately after installation; after authentication, immediately redirect to the app UI

The error message says:
During the automated check, your app did not successfully initiate authentication at install time. The app responded with an unexpected URL. Learn more about installation requirements.

Expected URL: https://admin.shopify.com/store/uvszh1-m5/app/grant
Actual URL: https://a32333127.ngrok-free.app/auth?hmac=28e28bdc4d22a3f6eca2b62011990d5b&host=YWRtaW3RvcmgxLW01&shop=uvszh1-m5.myshopify.com&timestamp=1758436320

The key point is that I have to go through /auth to get to the Shopify OAuth authorization page, so I don’t understand why this step isn’t allowed, or what I should change to pass.


Translated Answer:

With the error you are receiving, the Expected URL is pointing to your Shopify store’s admin URL

  • Expected URL: https://admin.shopify.com/store/uvszh1-m5/app/grant

This indicates that you have this admin URL set in your app configuration directly, specifically in the shopify.app.toml configuration file.

The Actual URL looks to be an Ngrok tunnel domain, you can use these tunnels for your App URL used for authentication, but you will need to specify this in the app’s toml configuration file, and deploy the app to ensure the updated config and app url is active.

Here’s some documentation on Shopify app configuration, and deploying apps to update the configuration.

If you can confirm that the app configuration has the correct non-admin url in the app_url field, please let us know the name of the app where this is occurring, and we can help look into this further.