Idea

Matt Laird avatar image
Matt Laird suggested

API Logout Call

This thread already exists, but it's old and I want to put it in the feature requests.

https://community.playfab.com/hc/en-us/community/posts/206710727-Is-there-a-logout-request-in-the-API-?flash_digest=313a31f181d08a84e1b6bdd5f4b622575d1667d0

I think there should be an explicit API call for the client to logout of PlayFab.

In our game, players might change from guest to Facebook account, change Facebook users, or logout back to guest.

I feel the API should allow for logout and login with new accesstoken / user details easily.

10 |1200

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

9 Comments

·
Daniel Kiefer avatar image
Daniel Kiefer commented

Agreed, unless there is a better way to workaround that kind of issue

10 |1200

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

smith.deven.e avatar image
smith.deven.e commented

I just recently started looking at playfab and it amazed me that there is not anything for logging out to make changing players easier.

10 |1200

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

brendan avatar image
brendan commented

Actually, changing players is as simple as signing in a new player. The Session Ticket you use is what identifies the player to us, so locally you could just delete it on a "logout", and have the player log back in to get a new one.

Thanks for voting on this, by the way - the more feedback we get, the better we can prioritize to meet the needs of the whole community!

10 |1200

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

smith.deven.e avatar image
smith.deven.e commented

Mind telling me what exactly I should delete? As stated I just started on this a day or two ago and logout is the one thing eluding me. Thanks.

10 |1200

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

brendan avatar image
brendan commented

Specifically, you could wipe out the Session Ticket. In general in our SDKs, it's stored as _authKey.

10 |1200

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

Matt Laird avatar image
Matt Laird commented

_authKey is a private variable stored inside PlayFabClientAPI.

Instead of each developer tampering with code that could cause problems when updating to the latest API source, I think it would be better for the client models to include a function like so:

 public static void Logout()
{
_authKey = null;
}
10 |1200

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

brendan avatar image
brendan commented

Yes, that would be the way to effectively "lose" the player session locally. However, it's really a misnomer, and I wouldn't want to confuse anyone - the player isn't actually signed out. The session ticket is still valid, and will be until it expires. We will be updating to a different session model that provides for a "true" Logout later on.

10 |1200

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

Thomas Brown avatar image
Thomas Brown commented

Just curious if the session model has been updated yet. Thanks in advance!

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.

brendan avatar image brendan commented ·

We'll be posting to our blog when we make this update - I'd recommend keeping an eye on it, as we'll be posting about upcoming features as well.

0 Likes 0 ·
Robert Bechara avatar image
Robert Bechara commented

Note for future comers to Simulate or remove the session of the current player is by calling ForgetAllCredentials in PlayFabClientAPI

10 |1200

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

Write a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

相关的想法