question

joel-4 avatar image
joel-4 asked

Invalid JSON error in C# SDK

Hi all,

I've encountered a very strange issue when using PlayFab's C# SDK on a Kubernetes instance.

My auth server exchanges tickets with PlayFab using the `/Server/AuthenticateSessionTicket` RPC, via the PlayFab C# SDK. When running locally, this works fine. However, when it's running in a container in Kubernetes (on Google Cloud), I consistently get 'Invalid JSON' exceptions back from the SDK. I sent a HTTP request myself rather than using the SDK, and it seems this may be because PlayFab is responding with HTML (a bad request page), rather than JSON, which is very odd. My HTTP request set the correct content-type header, so far as I can tell.

I've verified that my secret key and configurations are correct and the same as they are when running locally. Are there any special considerations I need to take into account when using PlayFab from within Kubernetes? Perhaps some header or encoding that is getting set by the SDK?

Thanks

Joel

sdksAuthentication
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

·
joel-4 avatar image
joel-4 answered

The problem was due to a newline character at the end of the secret which made PlayFab's JSON library freak out. Sanitise your inputs kids!

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.