Sign In Register

How can we help you today?

Start a new topic
Answered

Player Registration: Anonymous, then Username/Password

I noticed in the GameSparks documentation that you support both anonymous login with device ID and registration with a username/password combo. However, the documentation states that the two options are not compatible.


As I'm sure you'll agree, the ideal registration flow for a user is as follows:

1) Launch the game for the first time, automatically generate an account using device ID, exceptionally seamless.


2) Once the player is comfortable with the game, they decide to create a username/password combo for their account so they can recover their progress or sync between devices.


3) When the player wants to use social features or login with a social account, they link one of their social accounts (Facebook, G+, Twitter, etc).


Based on your documentation, it seems that #2 isn't possible if the user has previously generated an account based on device ID? I saw a topic that is a couple of months old (https://support.gamesparks.net/support/discussions/topics/1000044144) saying that this would be supported within a couple weeks - is it still coming down the pipe?


Using the NoSQL interface, do we have access to a user's login credentials? Would it be possible to manually specify a user's email/password in their player record if we create a custom call? Similar thing with social accounts: there's no way to unlink a social account, it seems, but can I essentially do it by erasing a player's social account link via NoSQL or something like that?


Best Answer

Hi Clark,


The merging of accounts is currently low priority functionality and is not currently supported.


However, you could create an event that fires off when the user hits the "register" button (which is not really connected to the register event), this event could save the address or Player ID to the DeviceAuthPlayer, then once you get the response from that event do the actual registration event.


The registration event creates the new player and logs them in, you can then fire off the same event which saves the email and Player ID to the player's script data.

Then an event that reads the DeviceAuth account and unlocks any purchases or relevant data for the new user, this would essentially "migrate" a user's account.


With regards to unlinking from a social account you can use the .SocialDisconnectRequest function to achieve this.

https://docs.gamesparks.net/documentation/request-api/misc-request-api/socialdisconnectrequest


Thanks,

Oisin.


2 people have this question

Answer

Hi Clark,


The merging of accounts is currently low priority functionality and is not currently supported.


However, you could create an event that fires off when the user hits the "register" button (which is not really connected to the register event), this event could save the address or Player ID to the DeviceAuthPlayer, then once you get the response from that event do the actual registration event.


The registration event creates the new player and logs them in, you can then fire off the same event which saves the email and Player ID to the player's script data.

Then an event that reads the DeviceAuth account and unlocks any purchases or relevant data for the new user, this would essentially "migrate" a user's account.


With regards to unlinking from a social account you can use the .SocialDisconnectRequest function to achieve this.

https://docs.gamesparks.net/documentation/request-api/misc-request-api/socialdisconnectrequest


Thanks,

Oisin.

I have testing the platform for our next game and researching the anonymous question like the original poster. I wanted to know how the situation is now for migrating a anon user to a registered user?

Hi Alain-Daniel,


Since my last post functionality has been added to the platform that allows for merging of certain accounts.
For example Device-auth merging with Facebook-Auth.


Let us know if we can help with anything specific.


Oisin

I have the same use cases as described by Clark.


Can a player account initially created by Device-auth, merge with username/password auth method?

It is possible. The trick is that the Device-Authentication is simply a hack of the username/password authentication. (At least, it feels like a hack when looking at the way it is implemented).


During Device-Auth, what the SDK does is to generate a unique string based on the device id and the OS, for instance "XXXXXX-ANDROID-91CE2A74-6428-5EC8-B9B4-24B2F039CB19". That string is considered the username for the Device-Auth with an empty password.


On the server, Game Sparks uses only one table/collection to hold all of the player data, whether they are anonymous users, username/password based, facebook logins, etc. So it is possible to convert Device-Auth to a Username/Password record.


Once you have someone logged in with Device-Auth, you can simply do a ChangeUserDetailsRequest with a new password/username. That will update the server record and change the username field from the deviceId-based string to the new user name.


However be aware that this will prevent future Device-Auth login attempts from that device. Well, not technically "prevent" them but it will be considered a brand new player if you do because it won't be able to find any record with the deviceId.


AD

Hi Alain-Daniel,


Thank you for your advice and instruction. I managed to test Clark's use case with the Test Harness. For those who may interest, the steps are:

1) Use DeviceAuthenticationRequest to create/login an anonymous player account

2) Use ChangeUserDetailsRequest to change username and password 

3) Use AuthenticationRequest to log in with username and password

4) Use FacebookConnectRequest to link FB account with this player


Ernest

Login to post a comment