文档

Service accounts

Call Unity Services APIs programmatically with service accounts
阅读时间1 分钟最后更新于 2 天前

Use service accounts to call Unity Services APIs, and to access and configure admin APIs.

Roles and permissions

Service accounts support role-based access control (RBAC) through roles. You assign organization roles and project roles to each service account. These roles give the service account permissions to perform specific activities, such as managing allocations. If you try to use a service account for an activity without the required permission, the API call authorization fails. For more information on roles for various Unity services, refer to the following pages:

Create a service account

To create a service account, follow these steps:
  1. In the Unity Dashboard, open the Account menu and select Manage organization.
  2. In the Administration menu, select Service Accounts.
  3. To create a new account, select New.
  4. Enter a name and a description for the service account.
  5. Select Create.
  6. Generate an authentication key pair for the service account.
    1. In the Keys section, select Add key. Unity generates a key ID and a secret key for the service account.
    2. Copy and securely store the values for Key ID, Secret key, and Authorization header.
      重要
      These values are displayed only once. If you lose the key values, then you need to create a new key.
    3. Select Done.
  7. To allow access to API endpoints, add a role to your service account at either the organization level or project level:
    • To grant the service account organization-wide data access for all projects in your organization, select Manage organization roles.
    • To grant the service account project-level data access for individual projects, select Manage project roles.
Your service account is created and you can use the key pair to authenticate and use the service account.
提示
You can use a service such as GitHub Actions Secrets or GitLab CI Variables to store the Authorization header value as a secret in your CI platform.