question

Michael avatar image
Michael asked

Unreal Engine Cannot call GetDeveloperSecretKey in a non-developer build!

Hi,

I have this all configured properly as far as I can tell, but it will not get past this point. The key is inserted both in Project settings and I make a call before running the command to set it as well. I'm able to use Client API calls just fine.

From what I can see it's a problem with this section of code in PlayFabAuthenticationContext.h

#if defined(ENABLE_PLAYFABSERVER_API) || defined(ENABLE_PLAYFABADMIN_API)

When researching, I came across other posts regarding these flags but that was when using it with Unity, which has an Editor plugin designed to help set these. I'm unable to find a solution for those using Unreal, but my guess is I can just insert them somewhere else? I want to be able to test the admin/server API within the Editor. Any ideas? Thanks!

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

element808 avatar image element808 commented ·

What exactly are you trying to do?

0 Likes 0 ·
Michael avatar image Michael element808 commented ·

I'm using the GrantItemsToUser api call. I haven't tested other server API calls but I'm pretty sure it isn't a problem with this specific call that is causing the assert crash, and rather a more generic configuration issue that I haven't figured out. I'm pretty sure any server/admin API call will fail as it will not ever retrieve the secretAPI key.

0 Likes 0 ·

1 Answer

·
element808 avatar image
element808 answered

We're using that same call on our project, but we only let our dedicated server have it as it's not a client. We created a custom function in C++ that can be called from blueprints, that determines whether or not whatever is calling it is a dedicated server or client and only if it's a dedicated server, will it provide the key. Even during the compile, the secret key is only built into the dedicated server executable, as not to let any client build have the secret key laying dorment in the code somewhere. If a tech savvy person reverse engineers your client code, they can easily find the secret key and take your project down. Just make sure your secret key could never be seen by clients.

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.

element808 avatar image element808 commented ·

That being said, in blueprints you have to call the "Set PlayFab Settings" node to set the secret key. Your secret key is found in your PlayFab Settings online.

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.