question

bodin avatar image
bodin asked

Getting error "Missing or invalid X-SecretKey HTTP header" on Playfab Game Server (Unity)

Hi,

sorry for asking a basic question. I'm very new for Unity networking.

I'm following the step from https://github.com/PlayFab/PlayFabGameServer

There's something different from the guide and downloaded project file.

from the guide "open up the StartUp scene in the StartUpScene folder."

but there's no "StartUpScene folder" nor "Start Up scene" in project file.

instead, there's "GameServerContext" folder & "ServerScene" scene file. so I started from here.

after I did follow the guide and hit run button, I got 2 error messages.

1. The remote server returned an error: (503) Service Unavailable.

2. Missing or invalid X-SecretKey HTTP header

I already added Title ID & Title Scret Key to the setting.

Could you please let me know how I can solve this problem?

Thanks in advance & Best regards,

Bodin

Custom Game Servers
setting.png (20.2 KiB)
error.png (26.8 KiB)
10 |1200

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

bodin avatar image
bodin answered

ok, I think I got it. (and feel so noob...)

I have to use the real secret key generated from Playfab dashboard to get it to work.
(I thought that I can use any string as Title ID & Secret key for local test.)

I think there should mention about this in the start up guide on https://github.com/PlayFab/PlayFabGameServer
(the present guide didn't even mention about secret key)

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.

JayZuo avatar image JayZuo ♦ commented ·

Secret Key is only needed for local testing. When actually using in Multiplayer, you do not need to provide it as it can be retrieved from command-line arguments. That maybe why the guide didn't mention it.

0 Likes 0 ·
bodin avatar image bodin JayZuo ♦ commented ·

@Jay Zuo

Got it.

but I think at least they should let the user know about it. for someone who want to start from testing locally, so they don't waste time for this.

0 Likes 0 ·
JayZuo avatar image
JayZuo answered

"ServerScene" scene is the right way to go for GameServer. However, I can't reproduce your issue. For local testing, you must provide both Title Id and Title Secret Key. And usually there would be a SocketException, but you can ignore it. I'd suggest you recheck the Title Id and Secret Key you've filled and also use the latest commit of the master branch.

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.

bodin avatar image bodin commented ·

Hi @Jay Zuo

Thank you very much for your reply. so I can ignore "WebException" error for now.

I already provided both Title ID & Title Secret Key in the GameObject "PlayFabServerManager" as seen in the image below. Is this the right place to put both info?


and I just downloaded the code from master branch last week, so it suppose to be the latest one.

0 Likes 0 ·
setting.png (51.5 KiB)

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.