question

Tudor avatar image
Tudor asked

Contact Email Address Profile Constraints

ContactEmailAddress is considered as part of sensitive information, which is fine, you would want to restrict others on getting that information with a simple GetProfile call.

That being said, why wouldn't it be possible to retrieve it in your own login call?

It would cut extra verification with a server call to know if the email was verified or not.

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

·
Simon Cui avatar image
Simon Cui answered

PlayFab provides flexible and secure approaches to retrieve a player’s profile. You surely can get ContactEmailAddress from a LoginResult with some prerequisites. Firstly, you need to enable “Contact email addresses” under “ALLOW CLIENT ACCESS TO SENSITIVE PROFILE PROPERTIES” through [Game Manager Portal] -> [Your Title] -> [Title settings] -> [Client Profile Options], referring to: Configure the player profile view constraints for the title. As the screenshot shown: 5788-p1.png

Then you need to customize the request body of your login API, like the sample Json of LoginWithCustomId request:

 {
   "CustomId": "testPlayer",
   "CreateAccount": true,
   "InfoRequestParameters": {
       "GetPlayerProfile":true,
       "ProfileConstraints": {
           "ShowContactEmailAddresses":true
       }
       },
   "TitleId": "*****"
 }

For more information, please refer to Request Body.

There is also an official tutorial you can refer to: Get the player profile via login operation.


p1.png (36.7 KiB)
4 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.

Tudor avatar image Tudor commented ·

Yes, I know that you can select that option, but again, I don't want to give the ability for other players to request someone else's contact email address. What I was asking was why your own login wouldn't give you the option to receive contact email address without having that sensitive profile property turned on.

0 Likes 0 ·
Simon Cui avatar image Simon Cui Tudor commented ·

If you don’t want to enable contactEmailAddress profile option, you can set contactEmailAddress in Player Data with Permissions set to “Private” or set it in Object for title player account. So that only the player himself can get contact email addresses, referring to: How to allow client access to contact email for own profile only - Playfab Community.

-1 Like -1 ·
Tudor avatar image Tudor Simon Cui commented ·

Clever workaround, but not appropriate. You're just adding complexity. Every time an email would get updated, you have to make sure you update that private field.

Plus, the API returns if the email is confirmed or not ( if you have the sensitive information checked ). Your suggestion does not work, because when the email is confirmed, it doesn't know how to set a private field. Who updates the verified status in the private field in Player Data?

The answer is the API does not offer this and it should.

1 Like 1 ·
Show more comments

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.