Choosing a user account with social providers

Hello, Nakama developers! I’m planning to integrate social authentication using the Nakama server. Everything is clear for me except one thing. I will explain the problem with an example: after installing my game the first time a user utilizes AuthenticateDeviceAsync() method to create a basic Nakama account. Let’s call it “ACCOUNT_A”. He plays the game a little bit, links Facebook account to it with LinkFacebookAsync() method. Then he decides to change the device (let’s pretend he lost his mobile phone) and starts the game from scratch. It creates a brand new account, let’s call it “ACCOUNT_B”. The user plays a bit the game with “ACCOUNT_B” and decides to link Facebook account to it. And here are the questions:

  • is it possible for the user to unlink Facebook account from “ACCOUNT_A” using “ACCOUNT_B”?
  • is it possible for the user to make a choice regarding which account he wants to continue playing with and be linked to Facebook account - “ACCOUNT_A” or “ACCOUNT_B”?
  • is it possible for the user to get some information about “ACCOUNT_A” to make informative decision (for example a game progress level or a nickname)?
  1. Versions: Nakama 3.5, Windows
  2. Server Framework Runtime language Lua

(1) No, this is not possible. But instead of linking to your Facebook account from Account B, you could authenticate back to Account A, unlink from there, and then perform a data migration to account B.

(2) Yes. Keep in mind that the user can access Account A or B. So you have all the data and UX capabilities necessary to migrate any data as you see fit or provide them with the option to continue with one account or another.

(3) Yes, for the same reasons outlined in (2).

The main distinctions to keep in mind here are between authentication, linking, and the device being played on. These are all independent concepts. Even though the user is on a new device, they can still authenticate to their old one via their social account. Just because the current device id is associated with their new account, doesn’t mean they can’t use their old account on the new device.