Nakama authentication fails: server key required

Hello,
I’m trying to use Nakama and do a simple user authentication, following this simple example:

Here is the error I get from the server

DEBUG:SCRIPT: authenticate_email() with coroutine
DEBUG:SCRIPT: HTTP	POST	http://xxx.xx.xx.xx:7350/v2/account/authenticate/email?create=true&username=britzl
DEBUG:SCRIPT: DATA	{"password":"foobar123","email":"bjorn@defold.se","vars":{"_":""}}
ERROR:DLIB: Not all bytes were handled during the response (45 bytes left). Method: POST Status: 401
ERROR:SCRIPT: HTTP request to 'http://142.93.3.23:7350/v2/account/authenticate/email?create=true&username=britzl' failed (http result: -3  socket result: 0)
DEBUG:SCRIPT: {"error":"Server key required","code":16,"message":"Server key required"}

Has anyone managed to solve this? I’m guessing the is some data we’re forgetting to send but I haven’t figured it out yet.

My dependencies:
image

Thanks for your help.

Have you configured your Nakama client?

I got it working.
The fix is to add a HTTP header

Authorization : "Basic base64_encoded_version_of_server_key:"

in the requests.

I’ll do a pull request once I have some time because the current version on the repo doesn’t work.

Hey @Lex , did you ever get around to doing the PR? I seem to be having a similar issue now when authenticating with GameCenter or Sign in with Apple.