通过 Shopify 静默验证客户 API

Silent authenticate customer via Shopify API

我们已经为我们的品牌建立了一个 Shopify 商店。 我们的用户已经登录到我们的网络应用程序和移动应用程序。我们的目标是在单一身份验证(即我们的网络应用程序和移动应用程序登录)下管理整个用户旅程。当用户随后访问 Web 应用程序和移动应用程序中的商店部分时,该应用程序应使用与他们现有帐户相同的凭据静默登录 Shopify 商店。

为此,我发现我们可以创建一个新客户here。 我的问题是:

  1. 这是管理用户的正确方法吗?
  2. 以这种方式管理用户是一种好的做法吗?
  3. 使用此端点需要哪些范围?

不,这不是解决您上述问题的正确方法。如果你按照你解释的方式去做,你会 运行 遇到的问题很少

  • 使 Shopify 用户的密码与您的系统保持同步。
  • 破解 Shopify 登录页面以发送 POST 请求然后重定向。

Shopify 在此类场景中提供 Multipass 功能。来自 Shopify Docs

Multipass login is for store owners who have a separate website and a Shopify store. It redirects users from the website to the Shopify store and seamlessly logs them in with the same email address they used to sign up for the original website. If no account with that email address exists yet, one is created. There is no need to synchronize any customer databases.

您可以阅读 Multipass 文档,只需生成一个有效的重定向 link,用户将无缝登录。但是,请注意,此功能仅适用于 Shopify Plus 套餐。