Design for login with authentication flow

Introduction

Text Express requires authentication with Facebook (FB SDKarrow-up-right) and Google Play accounts (Google SDKarrow-up-right). With those services, our players can safeguard their Text Express progress and play across multiple devices.

Bottom you can find a flow diagram I've designed on what will happen to the player’s Playfab account, whenever the player decides to authenticate with Google (same with Facebook), also followed with some technical explanations about how the functionality is achieved.

Flow diagram

Flow Diagram Part 1 (due to limitation in Gitbook it is split into 2 parts)
Flow Diagram Part 2 (due to limitation in Gitbook it is split into 2 parts)

Technical Explanations:

Step 5 of the flow diagram:

How to present information about the two needed Playfab ID accounts, when showing the "Comparing screen"?

Retrieving and showing the information of the currently logged Playfab ID "B" is easy as the client has this information. The hard part is retrieving the information of the other linked to your authentication service account- Playfab ID "A". At first I thought to use the Playfab client function- GetAccountInfo()arrow-up-right, but this wasn't an option:

Not an option to retrieve the other Playfab ID progress from the client side

As all player data is accessible only from the backend, a design had to be created with the backend developer for a function (also called a Cloud script function), which will retrieve and send the other Playfab ID progress to the client:

Backend function design for retrieving progress of another Player

Requesting Google linked Playfab progress:

The cloud script function for requesting the progress of an account linked with Google, the client (the game) has to include the Playfab ID, of that requested Playfab account, as a parameter. The Playfab SDK provides the client side function GetPlayfabIDsFromGoogleIDsarrow-up-right, which does exactly that and it should work.

⚠️See Realisation in Social Authentication in Text Express for further information about this⚠️

Requesting Facebook linked Playfab progress:

Requesting Playfab progress of an account linked with Facebook works a bit differently. The Facebook SDK, provides an unique Facebook User Id, which is enough for the backend to retrieve the progress of the Playfab account linked to that Facebook. Therefore, I send only the facebook Id of the needed account as a parameter for the cloud script function.

Step 6 of the flow diagram:

“Other Device” option chosen:

When the player chooses the "Other device" option, the game uses LinkAndroidDeviceIDarrow-up-right with ForceLink = true, in order to link the current device ID to the other Playfab account. However, this leads to leaving your second account ("this account") without any identities.

In order to track that and know that this account was previously to that player, me and the backend developer designed the following function StoreOldAccountInfo() function.

StoreOldAccountInfo() design cloud script function

A Playfab account with no identities, can no longer be logged in. However, if by any case, the player wants to get that account back, he can do that by contacting customer support. Then customer support has the tracking information about this lost account and can manually retrieve it back. In order to make it easier for the customer support to retrieve the account back I have created the following for them:

Steps to retrieve lost account guide

“This Device” option chosen:

When the player chooses the "This device" option, the game uses LinkGoogleAccountarrow-up-right / LinkFacebookAccount arrow-up-rightwith ForceLink = true, in order to link the Google/Facebook account to this Playfab account and continue their progress. If the player later on decides to log out of the service, each device will have its own Playfab ID progress.

The device, which wasn’t chosen:

The old device, which previously had the linked authentication service, stores locally that it shouldn’t use its Device ID at log in, but the authentication service account (Google or Facebook). Because of this, if the player starts the game on this older device, the game would start the progress which has your authentication account linked (the progress which was chosen in the “Comparing screen”).

Worth noting:

If your game has backwards compatibility (supports different versions), when you transfered your Device ID/Google account to another Playfab ID (Step 6), the developer needs to ensure that the version of the game installed on your device, matches the version of the data that other Playfab ID has. Every time Text Express starts and loads it checks if the version of the game matches the version of the data in Playfab, if not the game doesn't boot up and it shows you an update screen. This way we ensure that, the game and the data from Playfab are always in sync.

Text Express force update screen

<-- Back to where I left

Last updated