Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Account Already Linked Exception Workflow?

Discussion in 'Authentication' started by colerobinson44, Oct 26, 2023.

  1. colerobinson44


    Oct 4, 2022
    I've run into the following issue in my Authentication workflow for my game:

    This is a bit of an edge case but I'm not sure how I should resolve this situation. At the moment, I am simply setting a player pref so that the next time the user logs back into the app, their Google Play Games data will be used instead of the Anonymous.

    This somewhat resolves my issue as it works for the next time the user starts up the app. But I'm wondering how I would be able to have the user sign into their GPGS account upon catching this exception immediately.

    Do I need to somehow sign out of the anonymous login, or delete that login and then try to sign into GPGS? If so, how can I do this?
  2. erickb_unity


    Unity Technologies

    Sep 1, 2021
    Hello, we have documented this flow here:

    Since your player may have progressed differently on the anonymous account as well as his google play account, we generally recommend to let the players choose which account he wants to keep.

    If the player choose to keep his current account, you can perform a force link operation which will remove it from the previous one and link it to the one. If the player chooses the previously linked one, you can just sign out and sign in using google play.

    I hope this is useful, let us know if you have any questions.