Service accounts
Service accounts let you programmatically call Unity Services APIs, including the Multiplay API. You can create any number of service accounts, each with one or more project roles.
Service account roles
Service accounts support role-based access control (RBAC) through project roles. These roles give the service account permissions to perform specific activities, such as managing allocations. If you try to use a service account for something it doesn't have permission to do, the API call authorization fails.
Refer to Project roles for more information about specific roles.
Create a service account
The following steps create a service account for allocating and deallocating servers:
- Sign into the Unity Dashboard.
- Go to Projects > Service Accounts.
- Select Create service account.
- Name the service account and, optionally, add a description.
- Select Create.
- Go to Project roles, then select Add project role.
- Select the name of your project.
- Locate Multiplayer, then select Multiplay Allocations Admin.
Multiplay Allocations Admin is under Project roles.
Generate a service account key
To generate an authentication key pair for a service account:
Note: If you don’t already have a service account, refer to Create a service account.
- Sign into the Unity Dashboard.
- Go to Projects > Service Accounts.
- Open the More (⋮) menu for the service account to create a key, then select Edit. If you don’t already have a service account, refer to Create a service account.
- Under Keys, select Create key.
- This automatically generates a Key ID and Secret key pair for the service account. Save both the Key ID and the Secret key in a safe location.
- Select Done.
- View Authentication for more information on using these credentials on API requests.