Search Unity

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

Question Anonymous authentication and uninstalling

Discussion in 'Authentication' started by rbitard, Sep 1, 2022.

  1. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Hello, what happens to a user who signed up anonymously then uninstalled the application, will he be able get back to where he was if he reinstalls and sign in anonymously again ?

    I didn't see any explicit information about it in the documentation

    Thanks in advance,
     
  2. pixaware_pwedrowski

    pixaware_pwedrowski

    Joined:
    Oct 25, 2018
    Posts:
    116
    https://docs.unity.com/authentication/PlayerPrefs.html

    Based on this, I assume that it will store the authentication token in Player Prefs, so it may or not be retrieved after he reinstalls the app (it depends on the device), but to make the same experience for every player you can assume that this user will be treated as a new user.
     
    chengg_unity and SebT_Unity like this.
  3. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Yeah I saw that everything related to session (tokens and all) are saved there but I don't know if it's sufficient to say that he will be treated as new. I believe if they use something like a device ID he won't be treated as new but I don't know. I can try but it might vary from users too so I don't know if I can generalize
     
  4. rpuls

    rpuls

    Joined:
    Feb 3, 2017
    Posts:
    101
    I have been developing with the cloud save implemented for a few weeks now, (on andoid) And I have now about 20 different UGS users for my test mobile. So indeed it does not always authenticate with the same user.

    I am implementing Facebook as identity provider to maintain one player profile per individual.

    I still don't have a good enough user experience with sign-in and auto sign in flow, but I am planning on writing a blog post when I get there.
     
    chengg_unity and rbitard like this.
  5. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    That'd be awesome
     
  6. pixaware_pwedrowski

    pixaware_pwedrowski

    Joined:
    Oct 25, 2018
    Posts:
    116
    As long as Player Prefs are not cleared you should authenticate as the same user (if the token is valid).

    Any other authentication that requires userID/name etc and password will definitely be better but only if you store data backup in your database - otherwise, you will use pretty much the same flow as the anonymous option (keeping some tokens in device's memory.
     
  7. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Yeah I need to dig in google/apple sign in for at least
     
  8. chengg_unity

    chengg_unity

    Unity Technologies

    Joined:
    May 15, 2022
    Posts:
    68
    Hello everyone,

    You are right about anonymous sign-in is not a recoverable sign-in option. If a player reinstalls the game, they will get a new player account when they sign in anonymously. Their anonymous account would need to be linked with an identity provider to become recoverable.
     
    rbitard likes this.