Hi guys.
I’m looking for a good way to let users log in and save game data to the cloud. My game already uses Google Play Games Services (https://docs.coronalabs.com/plugin/gameNetwork-google/) for leaderboards and achievements, and I’d like to piggyback on that so the player doesn’t need to supply a password and create an account within my game. In other words, I’d like to create a row in my cloud database’s Users table that is linked to the player’s Google Play ID, a 21 digit integer returned by gameNetwork.request(“login” … )
That part’s straightforward, but I’m concerned about security. I only want that row in the cloud database to be accessible to a player who is genuinely logged into Google Play using that ID. If the only thing linking that row to the real user is that ID, then anyone who knows my ID (and I don’t think they’re secret) could spoof a request to the server and read/write my data.
The only way I can think to prevent this is ask the user to create a PIN or password within the game when they first save data to the cloud. And then if they ever change phones and need to access that cloud data, they’d need to reenter that PIN. But that’s a crummy user experience – players will forget their PIN, or just never enter one to begin with.
This must be a problem that others have solved: I’ve played plenty of games where the only thing I logged into was Google, and my whole user profile was available on multiple devices.
Thanks!