Sign In Register

How can we help you today?

Start a new topic
Answered

"Remember me" feature in login/password authentication

I'm building a game where user authenticates using login/password authentication mode. The issue is every time the game start, login and password have to be retyped. I was wondering if there is any good practice to store credentials and have "Remember me" feature, so that player does not have to retype credentials every time.


Currently I'm storing encrypted credentials in dedicated, serialized file, but I'm aware it is not a good and safe practice.


Social media authentication is planned, but I want to have universal credentials authentication as a base.


Best Answer

Hi,


The unity SDK caches authentication. If you open your game you should check if GS.GameSparksAuthenticated is = True. If so, then you dont need to prompt your user with a login screen, there's a valid authenticated user logged in.


Can you try that and see if it works for you?


Cheers,

Omar


> The unity SDK caches authentication.


Is there a way to check if the authentication is cached and the SDK is attempting to connect before the `GameSparksAuthenticated` event is raised?


I want to show either the login screen or a "Connecting..." screen depending on that.

I think showing the login screen for a second and then going to a different screen when `GameSparksAuthenticated` fires is not a great experience for the user.


2 people like this

that's true this was a big issue that "remember me" "feature me log in and password" thank you for solving our problems Tuft And Needle Coupons

 Hi,

Which SDK are you using?

Cheers,
Omar

Hi Omar, it's SDK v5.5.6.130.

Answer

Hi,


The unity SDK caches authentication. If you open your game you should check if GS.GameSparksAuthenticated is = True. If so, then you dont need to prompt your user with a login screen, there's a valid authenticated user logged in.


Can you try that and see if it works for you?


Cheers,

Omar

Thanks Omar, that's exactly what I was looking for! Actually I made a mistake earlier - I checked GS.Authenticated property in Start() method, instead of waiting for the result of event. I was not aware of this feature.

is this currently an option within the javascript SDK? 

 Hi Yaser,


No that's not a feature in the Javascript SDK.


Sorry for any inconvenience,

Omar

Login to post a comment