0

I have android game done in unity. I have server rest API made in .Net, which is using Microsoft SQL Database.

I would like to do some registration - creating new account and Authentication like modern games are using. They during the login screen determine if user existed or not and if user existed the user data are served to the client. If user do not exist the new account is created.

I dont want use password and username. Also want be able to access my game account in any device which is owned by my. (using same google account)

I would like to have authentication like modern android games. E.g Clash Royale, Clash of Clans, Modern Strike, Fire Age, Candy Crash Saga etc.

my questions are: What are best practices for android game registration/authentication ? Where is starting point I should start learn ? Any links would help.

I know how to create client, web api, also work with database, understanding hashing. What I am missing is best practice, how to do it properly. Or how to merge stuff i know to do it properly.

Also I did my homework: Searched that there is something like OAuth2, which used to login using 3rd party identity, which might be my google account ? But not sure if thats the way.

Egid

Riddlah
  • 302
  • 3
  • 15

1 Answers1

1

In registration on server make a unique guid for each user and send it to client. Client should save the id to use it for next logins. Now you can sync user game account with google account by saving the id of user in google savedgame. When user wants to login from another device he can sync with google and client get the saved id from google savedgame and use it to login. Users never see the guid and it only save and restore from google account

ali afshari
  • 62
  • 1
  • 7
  • Hi thank you for your comment. How should I generate GUID ? Is enoght to use autoincrement ID from user table or should I use some hashing (id + device only information + salt) ? About saved game, should I use this service ? : https://developers.google.com/games/services/common/concepts/savedgames Is there any also google service I need to learn about ?(for example u said another device with sync with google) – Riddlah Apr 02 '18 at 16:45
  • unique id should not be a simple string because another person can guess it. you imagine guid is something like combination of username and password. for creating unique id read this post : https://stackoverflow.com/questions/11313205/generate-a-unique-id – ali afshari Apr 02 '18 at 22:49
  • The google service you mentioned is which I talked about. on every device you should first sync the game with specific google account an then you can read and write values in saved games service – ali afshari Apr 02 '18 at 22:52