Authenticate Server

Hi,

I want to get access of the username of a player in the server side, which is stored in the cloud save: player data but to get access I need to log in with an admin account, I tested the ServiceAccount but there is no documentation about how to connect to the service account.

I tested this method:

ServerAuthenticationService.Instance.SignInWithServiceAccountAsync();

but I have this error:

ServerAuthenticationException: HTTP/1.1 400 Bad Request

Hello! I don't have an answer but I can add my two cents as I am in the same boat as you. I found this documentation: https://docs.unity3d.com/Packages/com.unity.services.authentication@3.1/api/Unity.Services.Authentication.Server.IServerAuthenticationService.SignInWithServiceAccountAsync.html#Unity_Services_Authentication_Server_IServerAuthenticationService_SignInWithServiceAccountAsync_System_String_System_String_ In my case I supplied both parameters that are required and I am stuck on error 404 Forbidden. I've given the service account about every permission I can find and nothing.

3 Answers

3

Did you fix the issue? I’ve tried almost everything!

Hello

Please make sure your service account has the Unity Environments Viewer role.
The operations needs to access the environments to get the environment id based on the environment name provided.
Unfortunately we do not provide enough information at this time in the error.

This is something we are looking to improve soon.

For me, it wasn’t because the service account didn’t have the Unity Environments Viewer role.

If that was the case for you, check this:

Also, you can check this guide i wrote: