I'm trying to login to Playfab in my multiplayer server using this code in UE4.27.2:
I can successfully login when testing the server with the LocalMultiplayerAgent but its not working on the server build, its giving me these errors:
I think this error is caused by some port not being open but i'm not sure, can anyone help me?
(The server build is being successfully deployed on Playfab)
Answer by Made Wang · Jun 13 at 09:51 AM
From the error message, the CA certificate is missing, you can try the solution in MpsSamples/amazon_root_ca.md at main PlayFab/MpsSamples (github.com).
Also, it is not recommended to call the client API on the server side. You could try to use LoginWithServerCustomId.
That worked, thank you so much!
I have changed that node to use the LoginWithServerCustomId, now I have one more issue, I'm trying to create a Group using the "CreateGroup" node from the Server but its giving me an error:
Do I need to change to Entity Global Title Policy with something to make it work?
[2022.06.13-11.43.43:283][181]LogPlayFab: Request: { "GroupName": "20.67.170.117" } [2022.06.13-11.43.43:485][187]LogPlayFab: Response : {"code":401,"status":"Unauthorized","error":"NotAuthenticated","errorCode":1074,"errorMessage":"This API method does not allow anonymous callers."} [2022.06.13-11.43.43:485][187]LogBlueprintUserMessages: [Main_GI_C_2147482596] NotAuthenticated [2022.06.13-11.43.43:485][187]LogBlueprintUserMessages: [Main_GI_C_2147482596] This API method does not allow anonymous callers.
I am logged in tho, the CreateGroup happens after the "On Success" pin from the "LoginWithCustomServerID".
LoginWithServerCustomId does not automatically store the EnityToken, you need to get the EntityToken in the login callback and manually store it in request.AuthenticationContext when calling the Entity API, refer to the code below.
PlayFabGroupsAPI.CreateGroup(new CreateGroupRequest { AuthenticationContext=new PlayFabAuthenticationContext { EntityToken=" " }, GroupName = "serverTest" }, (result) => { Debug.Log("Create Success"); }, (error) => { Debug.LogError(error.GenerateErrorReport()); });