question

Denzie Gray avatar image
Denzie Gray asked

Getting Platform During Custom Auth

Thanks for the help before!

I am back, and I have a few questions using the following link as reference:
https://docs.microsoft.com/en-us/rest/api/playfab/server/authentication/authenticatesessionticket?view=playfab-rest

1. How are title display names set?

- What do I do if multiple Platforms are linked?
- Does each platform get a display name? I know they have a separate username but is this the same for title display names?

Let's assume I have the data from the server.AuthenticateSessionTicket().

2. Is there a way to tell what platform the user used to login?(Steam, PSN, etc)

I ask because I would like to:

1. Login via Steam or some supported platform.
2. Determine that platform and retrieve the Username from that platform.

3. Use that retrieved name and set it to the Title DisplayName so it can be used for leaderboards and searches.

NOTE:

I am doing this in CloudScript - no C# or client side examples or answers please.

EDIT:
What is the difference between PsnAccountId & PsnOnlineId

Is the former the email and the later the 'game name' or vice-versa? I didn't see much info in the page.

Looking Here:

https://docs.microsoft.com/en-us/rest/api/playfab/Server/account-management/GetUserAccountInfo?view=playfab-rest#usertitleinfo

I see a field called 'Origination'. I am looking for something like that but for login.

MatchmakingAccount Managementmultiplayer
10 |1200

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

Rick Chen avatar image
Rick Chen answered

>> How are title display names set?

Title display name can be set using client API UpdateUserTitleDisplayName.

>> Does each platform get a display name? I know they have a separate username but is this the same for title display names?

Third party platforms have their own usernames some of which are not stored in PlayFab and they are different properties from title display names.

>> Is there a way to tell what platform the user used to login?(Steam, PSN, etc)

Different platforms have different login APIs in PlayFab, for example, LoginWithSteam and LoginWithPSN. You could put the code of retrieving username in a platform inside the successful callback of corresponding platform login API on client side.

>> What is the difference between PsnAccountId & PsnOnlineId

According to this document: Information about your Online ID, the PSN online id is the name shown when you play games online. While Psn Account id is unique identifier for the PSN account.

10 |1200

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

Denzie Gray avatar image
Denzie Gray answered
@Junjin Chen

"Title display name can be set using client API UpdateUserTitleDisplayName."

May I have a working, Cloudscript example?

"Different platforms have different login APIs in PlayFab, for example, LoginWithSteam and LoginWithPSN. You could put the code of retrieving username in a platform inside the successful callback of corresponding platform login API on client side."

I am asking for a way to see the platform a user is on via CloudScript.
What steps should I take?

3 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.

Rick Chen avatar image Rick Chen ♦ commented ·

You mentioned that you would like to do the following via CloudScript:

1. Login via Steam or some supported platform.

2. Determine that platform and retrieve the Username from that platform.

3. Use that retrieved name and set it to the Title DisplayName so it can be used for leaderboards and searches.

It is not feasible because:

  1. The API UpdateUserTitleDisplayName is only available for client or admin, the Login APIs are Client APIs. The Client APIs and Admin APIs are not available on CloudScript.
  2. For some platform, the username of that platform is not stored in PlayFab and is not available on CloudScript.

It is better to implement the logic on client side.

May I ask what will be done if the player login with a 2nd platform? Should the title display name of player be replaced by the 2nd platform’s username?

0 Likes 0 ·
Denzie Gray avatar image Denzie Gray Rick Chen ♦ commented ·

@Junjin Chen

"For some platform, the username of that platform is not stored in PlayFab and is not available on CloudScript."

Is there a list of platforms so we can see which ones store the usernames?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Denzie Gray commented ·

The platform’s info that is stored in PlayFab could be found in: https://docs.microsoft.com/en-gb/rest/api/playfab/client/account-management/getaccountinfo?view=playfab-rest#useraccountinfo

From the document, you can find whether the platform stores the username in PlayFab.

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.