question

John Peterson avatar image
John Peterson asked

Can CloudScript impersonate another player?

Dear PlayFab community,

If I have a CloudScript endpoint that gets invoked by PlayerA, can I have that endpoint call another endpoint on behalf of another player (e.g., PlayerB)? In other words, I’m logged in as PlayerA, and I want to basically impersonate PlayerB from within the CloudScript call to call a different endpoint.

Thanks in advance for any help!

apisCloudScript
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

·
Hernando avatar image
Hernando answered

CloudScript can call Server API to modify data for any player, as long as the PlayFabId of the specific player is provided.

So, you can call ExecuteCloudScript from client playerA and pass the PlayFabId of playerB as the function parameter. Then in the CloudScript, call Server API with the PlayFabId from parameter "args".

However, the security of this way is risky, so it is not recommended. If you like, please post your demand scenario, I believe that most scenes will have a safe and effective solution.

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