question

DP avatar image
DP asked

Bug in UE4 GetEntityToken implementation?

I think I've found a logic bug in the UE4 PlayFabPlugin related to GetEntityToken. I'm attempting to call GetEntityToken from a dedicated server binary. I've defined the "ENABLE_PLAYFABSERVER_API" for my dedicated server target. This should allow me to use the developer secret key, and appears to work as anticipated.

As I trace through the code however, I ran into this bit of branching logic:

https://github.com/PlayFab/UnrealMarketplacePlugin/blob/1.50.201207/4.25/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp#L273-L278

Which, as I read it, is naively checking the value of these booleans and not really paying attention to the request's auth context/intention whatsoever.

Here is the bug:

https://github.com/PlayFab/UnrealMarketplacePlugin/blob/1.50.201207/4.25/PlayFabPlugin/PlayFab/Source/PlayFab/Private/PlayFabAuthenticationAPI.cpp#L102-L105

In GetEntityToken, the `useEntityToken` bool is set to true along with `useSecretKey` and `useSessionTicket`. If you recall the branching logic above, there is no way to send this API request w/o always sending the entity token, exclusively. Locally, I tried commenting out entity token and session ticket and suddenly I was able to pass along the secret key as expected.

Am I missing something here? This feels like a bug to me. I tested with the most recently published version 1.50.201207 on UE 4.25.

Authentication
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

·
Citrus Yan avatar image
Citrus Yan answered

Yes, this is a known issue previously discussed in this thread: Authentication as a server to make API calls - Playfab Community. We’ve reported this issue to the engineer team for a fix however there are no updates yet. Right now, please manually modify the source code as suggested in the aforementioned thread.

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

DP avatar image DP commented ·

I have a robust solution I'm willing to contribute in the form of a pullrequest, I'll send it over on GitHub.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan DP commented ·

Great! Thanks for sharing:)

0 Likes 0 ·
DP avatar image DP Citrus Yan commented ·
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.