question

se avatar image
se asked

Persisting login credentials

How can I persist the login credentials for a user so that the user do not need to re-enter login information between each restart of the game?

What info do I need to store, and how to I use it afterwards in order to achieve this? In my case, I use Unreal Engine SDK.

Authentication
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

se avatar image se commented ·

In the documentation it says "has stored login" in the flowchart. I think my question essentially is "what is stored in that step, and how to utilize it". Is the "best practice" to store the users plain text password?

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

You seem to want to implement a “remember me” feature for the login mechanism. The flowchart in this documentation is targeted to describe anonymous login, followed by adding a recoverable login mechanism. “Has Stored Login” means “If this player has a recoverable PlayFab account or not?”. A good practice is to flow this flowchart to add the recoverable account for players. After completing that, then you need to consider how to store the recoverable account’s credentials in the local device.

There is an official Unity sample -- PlayFabSignIn that gives an example of how to implement the “remember me” feature. Currently, Playfab only provides this Unity sample of the login mechanism, but you can refer to its implementation logic to do the same in Unreal Engine. In this sample, the player’s login credentials are stored in the Unity built-in static class -- PlayerPrefs. For example, on Windows, PlayerPrefs are stored in the registry under HKCU\Software\[company name]\[product name] key.

You can imitate it to find the corresponding storage method in Unreal. You can choose to store the user CustomID in plain text in the registry, or you can encrypt the credentials on your own. It depends on your safety requirements. Besides, we would suggest you add the corresponding tips in the game UI to guide players only to store the credentials in the trusted devices.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Aric Kuter avatar image Aric Kuter commented ·

Hi Sarah. Is this sample that stores the login info in PlayerPrefs, secure? As I understand PlayerPrefs is not secure at all. Thanks.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.