question

jamilkassis avatar image
jamilkassis asked

Anonymous login is linking to an existing email account.

Hi, I am facing a problem regarding this matter. Let me explain:

On Device A: I logged in anonymously using device id, then I created an email account (AddUsernamePassword API). Then The device id and email are linked.

On Device B: I logged in anonymously and logged in using the email account created above and force link with this device ID.

I cleared all data on Device A and logged in anonymously, then the playfab account is relinking the device A id with the email account created above ( I am not logging in using email). How is that?

Every step I mentioned above is completed successfully but what is happening here? why it is linking to the email address if it is anonymous login only? I didn't check a third device yet.

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

>> On Device B: I logged in anonymously and logged in using the email account created above and force link with this device ID.

So there are 3 steps when doing this:

  • logged in anonymously
  • logged in using the email account
  • Link with this device ID.

If I understand correctly, the current logged in account is still account A. Hence the following steps will add another device ID identity to account A. Please note that a player account can have multiple authentication identities including Device ID, which means after your actions, both IDs on 2 devices can access the same account.

A proper process will be:

  • logged in anonymously
  • logged in using the email account
  • Call UnlinkAndroidDeviceID API, the specific ID is not required in the request and the most recent device ID (only one) will be removed.
  • Link with this device B's ID.

PlayFab will allow link multiple Android Device ID, but only the most recent will be displayed in the API call and Game Manager. We highly recommend unlinking the previous ID before linking a new Device. If not, the previous IDs will be hard for maintenance.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jamilkassis avatar image jamilkassis commented ·

So, according to my understanding, I can't use forcelink to unlink and then link in one request. And I need to handle both ios and android linking and unlinking according to their api right?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ jamilkassis commented ·

You can, but here is the scenario. For example, you have 2 accounts

  • Account A: has Custom ID A, Device A's ID
  • Account B: has Custom ID B, Device B's ID

When B is logged in, you can call LinkAndroidDeviceID, with ForceLink as true, to link Device A's ID. After that

  • Account A: has Custom ID A
  • Account B: has Custom ID B, Device B's ID, Device A's ID

Device A and B will log into Account B. and only Custom ID A can access account A.

    1 Like 1 ·
    jamilkassis avatar image
    jamilkassis answered

    Thank you for your help! It is solved!

    10 |1200

    Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

    Write an Answer

    Hint: Notify or tag a user in this post by typing @username.

    Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.