question

Yuriy Granin avatar image
Yuriy Granin asked

GetMatch - server authentication error - UE4

Error Code: 1074
Error Name: NotAuthenticated
Error Message: This API method does not allow anonymous callers.

Didn't get how that trick with vaRest can solve this: https://community.playfab.com/questions/37781/getmatch-server-authentication-error.html

10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered
@Yuriy Granin

There is a known issue in the PlayFab Unreal SDK that would block you using the DeveloperSecretKey as the request header to call the API GetEntityToken. Using an external REST Plugin is one of the options to bypass this issue. Currently, you can fix this issue by modifying the SDK manually. Before you modify the source code of the PlayFab SDK, you may need to duplicate the plugin file to your project first, like the file structure of our ExampleProject. Then you can find this file in the plugin file -- PlayFabAuthenticationAPI.cpp, comment out the “else” from lines 273 to 277. Then rebuild the solution.

 // Headers
    if (useEntityToken)
        HttpRequest->SetHeader(TEXT("X-EntityToken"), CallAuthenticationContext != nullptr ? CallAuthenticationContext->GetEntityToken() : pfSettings->getEntityToken());
    /*else*/ if (useSessionTicket)
        HttpRequest->SetHeader(TEXT("X-Authorization"), CallAuthenticationContext != nullptr ? CallAuthenticationContext->GetClientSessionTicket() : pfSettings->getSessionTicket());
    /*else*/ if (useSecretKey)
        HttpRequest->SetHeader(TEXT("X-SecretKey"), CallAuthenticationContext != nullptr ? CallAuthenticationContext->GetDeveloperSecretKey() : pfSettings->getDeveloperSecretKey());

After you modify the SDK, the following blueprints should work fine.


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.

Yuriy Granin avatar image Yuriy Granin commented ·

This worked well for me. Thank you very much!

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

If you are using C++ to develop the project, you can ignore the workaround that using external REST Plugin. Have you called the GetEntityToken to get the title entity before you call the GetMatch API for the server? If you want to get the title entity, you needn't log a player in, and you need to set the secret key before you call the GetEntityToken.

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.

Yuriy Granin avatar image Yuriy Granin commented ·

No, I use C++ only for SDK integration but for stuff like this I use blueprint functions from playfab's plugin for UE4.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Yuriy Granin commented ·

Thanks for clarification, we will confirm the updates of the issue.

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.