question

brandonpearce avatar image
brandonpearce asked

Automatically Login to Playfab account on game reboot?

Hi, I've been trying to figure out how to allow my players to automatically log in to their registered Playfab account (not anonymous login) once they have restarted the application.

Right now I've seen there is a session ticket that is used to authenticate subsequent API calls, but from what I can tell there is no way to use this to automatically login once restarting the game. I see this can be done with 3rd party authentication methods such as Facebook, Google, etc by storing their auth tokens locally, but this option does not seem to be available for solely Playfab accounts.

Is there no way to have automatic logins after restarting the game?

Thanks for any advice.

Authentication
10 |1200

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

1 Answer

·
Seth Du avatar image
Seth Du answered

PlayFab is a service based on RESTful API, which is stateless. There is no logged-in state and as long as a session ticket is valid, a player can access PlayFab service. A session ticket will last around 24 hours and if you keep it locally, it should work after the app is restarted.

Anonymous login should be a feasible solution, but I am not sure what’s the specific need for your project. Login with device ID is another suggested way of login and is more secure than custom ID.

You may also refer to this documentation:https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/login/login-basics-best-practices.

2 comments
10 |1200

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

brandonpearce avatar image brandonpearce commented ·

How would I reuse the session ticket on subsequent runs?

Even if I was able to do that, a limited automatic login window of 24 hours seems extremely limited from a business perspective. Is it recommended to just use 3rd party login mechanisms like Facebook and Google? Because in most games being able to automatically login past 24 hours seems standard and basic PlayFab accounts don't seem to support that.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ brandonpearce commented ·

Storing Session ticket locally should work. If you are using third party login, to access PlayFab service, you still need to call login related API, like LoginWithFacebook. The process will be [get access token from 3-rd party platform] → [use access token to log into PlayFab] → [get session ticket from PlayFab so that player can call PlayFab client API]

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.