現在、私たちのWebアプリに登録したユーザーのメールアドレス、UserIdで、
Shopify Webチェックアウトにログイン(シングルサインオン)を実現するためMultipass APIの利用を検討しています。
そこでお聞きしたいことは、一度MultipassログインでShopifyに登録したユーザーに紐づいたアカウントのメールアドレスをWebアプリ側で変更した場合の対応方法についてです。
Shopifyではメールアドレスに応じてカスタマーが作られるため、別のメールアドレスで再度multipass APIでログインをすると、別カスタマーとして登録されてしまうかと思いますので、こちらの対応方法などをお聞きしたいです。
- 対応方法を知りたい手順の流れ
-
別Webアプリにログイン
-
別Webアプリで、Storefront APIで商品追加などを行う
-
multipass APIで、Shopify Webチェックアウトにログインしてリダイレクト
-
Webアプリでメールアドレスを変更
-
再度、multipass APIで、Shopify Webチェックアウトにログインしてリダイレクト
=> 3. で作成されたカスタマーとは別のカスタマーとして登録される。
こちらの対応として、multipassログインのJSONに含められる「identifier」に、一意の値(例: UserId)を含めることで、別のメールアドレスでも同じユーザーとして扱われるのかと考えているのですが、「identifier」の機能としてはそういったことができる認識でよかったでしょうか?
https://shopify.dev/api/multipass
Shopify uses email addresses as unique identifiers for customers of a shop. When registering customers in Shopify, the merchantmustset the unique identifier in the “identifier” field in the following cases:> > - The site uses other identifiers (such as usernames)> - Two different users of the site might be registered with the same email address If the email address is always unique, setting the “identifier” field isn’t required. Only one Shopify account can use a specific email address. Registering a second customer with the same email address (even with a different “identifier”) will result in an error.
また別の対応方法、例えばWebアプリ側のメールアドレスの変更に応じて、Admin APIなどでカスタマーの情報更新を行うことが必要でしょうか?