Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Account Already Linked Exception Workflow?

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

  1. colerobinson44

    colerobinson44

    Joined:
    Oct 4, 2022
    Posts:
    2
    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

    erickb_unity

    Unity Technologies

    Joined:
    Sep 1, 2021
    Posts:
    90
    Hello, we have documented this flow here: https://docs.unity.com/ugs/en-us/manual/authentication/manual/identity-management

    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.