Best mobile ID, framework to use for online game's database

Started by
2 comments, last by abdo 8 years, 11 months ago

Hi,

I am making a simple game where I want to save simple user data (coins, status, etc..) on a server.

I have two questions.

First:

I do not want the player to be forced to create account or log in to start playing, so I want to auto register new users on my server using some ID, then if he created account or signed in using facebook, I change the database record accordingly.

Now what is the best ID that I can use to auto-register the user.

I am using unity and creating the game for android, iOS.

Is it best to use the gamecenter ID from the ultimate mobile plugin like the following?

https://unionassets.com/ultimate-mobile/sing-in-251

UM_GameServiceManager.instance.player.PlayerId

Is there a way to get the e-mail of the user and use it to auto-register?

Second:

I can create the server application and database my self, as it is not that complicated, but if there is a server framework for this kind of stuff (register, login, store coins and other user data), I would like to save time and use it.

Is there a recommendation for such framework?

Any help is greatly appreciated.

Thanks for advance.

Advertisement

1:

External authentication/authorization systems (as implemented by Facebook, Live, Google and several others) typically work as follows:

1: user requests access to a secured service

2: service redirects user to auth provider's login window

3: auth provider gives a security token (a temporary key of sorts) to client and redirects client back to the secured service

4: client passes the security token to the secured service as proof of identity (and feature authorization)

5: secure service verifies the token so as to ensure that the user did not generate it by him/herself, that it has not expired, and whatnot

6: at secure service, if token is successfully verified and token contains necessary claims (facts about the user), then proceed with secured functionality

Again, typically, one of the claims of the token is the user id given by the authentication service. This id, along with the auth provider id, is what you'd store (at the very least) in your own authorized user database. You can also typically get the user name from one of the claims of the token.

Do note that your application ("secure service" in the preceding list) needs to be registered to the auth provider so that they can generate tokens that are uniquely usable by your application only. If this step were to be omitted, any token issued by the provider (think many other applications) could be used to authorize access to your application, which is usually highly undesirable.

2:

If you're on Windows Server, try out Entity Framework (for database abstraction) and Identity Framework (for convenient access token handling). Others can probably give recommendations for other server platforms.

Niko Suni

You can use https://github.com/strongloop/loopback for build you own server quickly

Thank you both @Nik02, @rkmax . That was quite helpful!

I would like to also add that I found this game framework which seems promising.

https://github.com/ScutGame/Scut

Also I though I will use the game services ID for player authentication to avoid asking user to enter username and password.

This topic is closed to new replies.

Advertisement