question

Jade Bourque avatar image
Jade Bourque asked

Does not allow anonymous callers despite calling from server with secret key

Hey, I might be misunderstanding how the API works here, I'm trying to execute a custom cloud script function from the server. I'm using the non-entity call currently but I did try using the entity cloud script function, to no avail. I keep being thrown an anonymous callers error when the client doesnt have the secret key despite the server having access to the secret key and also calling Get Entity Token.

I am passing in a player's master ID, I suspect this might be where I'm having issues? Should I be instead passing in the player ID through the cloud script function's params instead of those of the request itself? I did notice the docs don't indicate that it needs the PlayfabId param at all.

I need to run this function through the server because it needs to be able to execute even if the client force-quits the game, at which point their player controller will be destroyed.

 [2024.03.06-23.13.53:027][395]LogPlayFab: Request: {
         "FunctionName": "SaveCharacterData",
         "FunctionParameter":
         {
                 "Data":
                 {
                         "Online": false,
                         "Name": "Akutuk",
                         "Biography": "",
                         "Family": "Cervidae",
                         "Level": 6,
                         "Experience": 6,
                         "Stats": "{\"STR\":2,\"TRA\":4,\"STA\":7}",
                         "SurvivalResource": "{\"Hunger\":2329.45703125,\"Thirst\":85.5701904296875,\"Stamina\":100,\"Health\":100}",
                         "Nameplate": "{\"Title\":\"\",\"Badge\":\"None\",\"NameplateColour\":\"00000000\"}",
                         "Transform": "{\"Location\":\"X=132705.250 Y=155353.266 Z=-2065.675\",\"Rotation\":\"P=0.000000 Y=21.909391 R=0.000000\"}",
                         "CharacterId": "750796395A59B44"
                 }
         },
         "GeneratePlayStreamEvent": true,
         "PlayFabId": "43BBDE44ED394F3F",
         "RevisionSelection": "Live",
         "SpecificRevision": 0
 }
 [2024.03.06-23.13.53:528][411]LogPlayFab: Response : {"code":401,"status":"Unauthorized","error":"NotAuthenticated","errorCode":1074,"errorMessage":"This API method does not allow anonymous callers."}

6862-image.png

apisCloudScriptunreal
image.png (138.5 KiB)
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.

Jade Bourque avatar image Jade Bourque commented ·

Oops my formatting was destroyed once posted, sorry for the hodgepodge that resulted!

0 Likes 0 ·

1 Answer

Jade Bourque avatar image
Jade Bourque answered

Problem solved, there were a few issues with my cloudscript function itself, Using the server API ExecuteCloudScript and passing in the player's master ID was fine !

10 |1200

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