question

ericstock avatar image
ericstock asked

How can I access user's ip address from cloudscript?

Hello. I am looking to access a player's ip address from cloud script. I have not been able to find how to do this when looking through the api docs. I am guessing that this is possible as log in information contains ip addresses for players. Please advise.

Player DataCloudScript
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Hi Eric,

First thing you need to know is, PlayFab enables full GDPR compliance, which means that we are making sure that the service allows for the creation of games and apps that comply with the GDPR. The IP address is considered as PII(personally identifying information), hence there is no such API to retrieve the IP address directly. Obviously, we can’t guarantee your title will be GDPR compliant, since it’s always possible for you to save PII to player data or your own servers. Therefore, we would always recommend that you review your plan for compliance with your own legal counsel.

Now, regrading accessing IP addresses from CloudScript, a possible way is that you save them ahead in player data(or player internal data) and call GetUserData/GetUserInternalData afterwards.

10 |1200

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

ericstock avatar image
ericstock answered

Yes I see that I can store information as Player Data. However I would like to know how to find the ip address in the first place. Is there a way that I can see the player's ip address inside a cloudscript handlers.somefunction? Or do I need to have my game client first connect to a url such as https://api.ipify.org . Then in the response, collect the ip and send it as a parameter to a playfab cloudscript function?

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.

ericstock avatar image ericstock commented ·

Hello. Just adding an additional comment to help bump the priority on this message. As I understand the ip address is not available inside a cloudscript handlers.somefunction. I would like to confirm this and then I would like to ask if it is possible to have this functionality exposed/added.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan ericstock commented ·

Hi Eric, sorry for this late reply, I didn't get your last message for some reasons.

>>Is there a way that I can see the player's IP address inside a cloud script handlers.somefunction?

PlayFab enables full GDPR compliance, which means that PlayFab will not gather PII such as IP addresses, hence you're not able to get it inside a cloudscript handlers.somefunction.

>>Or do I need to have my game client first connect to a url such as https://api.ipify.org . Then in the response, collect the ip and send it as a parameter to a playfab cloudscript function?

Yes, you may need to gather ip by yourself first and perform the following operations.

>>I would like to confirm this and then I would like to ask if it is possible to have this functionality exposed/added.

It's unlikely for PlayFab to gather such data, hence this functionality won't be exposed/added.


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.