Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by tourtellotronald2020 · Apr 23 at 01:53 AM · unity3dAccount ManagementAuthenticationdocumentation

How to log into original account on reinstall or new device?

So I followed the documentation to a degree for account log in basic practices.

1. I log player in using anonymous login method associated with their device.

2. I at a later point, direct them to adding an account email and password for recovery.

3. If they do, the account is correctly linked with the credentials provided.

Now what my issue is, what happens when a user has a fresh start. Currently, it will just log them in with their device ID which would be new and create a new account. In theory i think i can have them log in with their original credentials, but even if I learn how to do this, which i eventually will, with my current implementation it will log in using the new ID every time on start up and they'd have to relog in. Not sure how to go about signing into their correct account silently every time on start up. I read that i shouldnt be storing their email and password in PlayerPrefs so not sure how to login with email and password without that.

(I know this question has been asked a few times over the years but none of the answers given helped me which is why I'm asking now).

I presume there needs to be some check of a playerpref to know whether i should login with their device id or not. But not sure where to go past there without storing their password and email locally.

Comment
Satriyo Aji Nugroho

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Made Wang · Apr 25 at 08:36 AM

For logging in with a device ID, when a new device ID is used, a new account will be created and logged in with the new account. We call this login method anonymous login, players usually do not know the specific device ID, so we recommend that when players play for a period, they are prompted to link this account to a third-party account or add an email and password. In this way, when players change devices, they can log in to their original accounts with their email addresses and passwords.

When you call LoginWithEmailAddress to log in on the new device, you can link the device ID of the new device with the current account, so that on the new device you can use the new device ID to log in instead of entering the email address and password every time, which we call silent login.

To clarify, PlayerPrefs is a method used in Unity to store some data locally, and Unity does not recommend storing sensitive information such as passwords in PlayerPrefs, refer to Unity - Scripting API: PlayerPrefs (unity3d.com).

About what is anonymous login, how to link new device ID, how to implement silent login, you can refer to Account linking quickstart - PlayFab | Microsoft Docs.

Also, you can refer to this example to further refine your login method.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Unity Editor Extension Login 2FA 1 Answer

    Login through email address fails 1 Answer

    Unicorn Battle iOS build returns "GetAccountInfo Timed out after 10 seconds." 1 Answer

    Facebook/Google LogIn using the same PlayFab Account 2 Answers

    Unique account per device 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges