question

Le-Roy Karunaratne avatar image
Le-Roy Karunaratne asked

LoginWithCustomId works with Postman, fails in Godot

Got a confusing situation here. TitleId is hidden.


In Postman the request works, and I have created "postman_user". However, running the code in Godot (C#) I receive

"
Something went wrong with your first API call. :(
Here's some debug information:
Error: TrustFailure (Authentication failed, see inner exception.)

"

public override async void _Ready()
    {
        PlayFabSettings.staticSettings.TitleId = "*****";
        await LoginToPlayFab();
    }

    private async Task LoginToPlayFab()
    {
        var request = new LoginWithCustomIDRequest { CustomId = "godot_user", CreateAccount = true };
        var loginTask = await PlayFabClientAPI.LoginWithCustomIDAsync(request);
        OnLoginComplete(loginTask);
    }

    private void OnLoginComplete(PlayFabResult<LoginResult> taskResult)
    {
        var apiError = taskResult.Error;
        var apiResult = taskResult.Result;

        if (apiError != null)
        {
            GD.Print("Something went wrong with your first API call.  :(");
            GD.Print("Here's some debug information:");
            GD.Print(PlayFabUtil.GenerateErrorReport(apiError));
        }
        else if (apiResult != null)
        {
            GD.Print("Congratulations, you made your first successful API call!");
        }
    }

I have also tried setting the TitleId in the LoginWithCustomIDRequest with no success.

Can anyone help?

10 |1200

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

Le-Roy Karunaratne avatar image
Le-Roy Karunaratne answered

Looks like it works in Godot 4, not Godot 3.5.1. So, I suspect it has something to do with the C# compatibility. Which is real annoying because Godot 4 doesn't have C# export to web...

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.

Le-Roy Karunaratne avatar image Le-Roy Karunaratne commented ·

You can change your Godot 3.5.1 solution to

<Project Sdk="Godot.NET.Sdk/3.3.0">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <EnableDynamicLoading>true</EnableDynamicLoading>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="PlayFabAllSDK" Version="1.140.221024" />
  </ItemGroup>
</Project>

Still struggling to use async, it doesn't look like it can support that for some reason. Maybe I'm just too tired.


HOWEVER, at least the PlayFabSDK is now usable and the LoginWithCustomIDRequest goes through!

0 Likes 0 ·
Le-Roy Karunaratne avatar image Le-Roy Karunaratne commented ·

Nevermind, the comment is wrong. I misread the data on PlayFab.

Looks like PlayFab SDK is not compatible with Godot 3.5.1

0 Likes 0 ·
tony-1 avatar image
tony-1 answered

I've dived deep while debugging, and noticed, that this is a problem with mono framework, and the ssl certificate verification fails, more details could be found here: https://github.com/mono/mono/issues/12406

you need to manually use the cert-sync tool to upload all needed certificates to mono built-in certificate store.

As additional link helped me to resolve an issue on MacOS Ventura: https://gist.github.com/chmac/78a2dd2bd346026f55fa1bae4f885ae3

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.