# 身份验证

> Authenticate Logging API requests using Service Account credentials and learn to configure access controls.

Logging API 仅接受经过身份验证的请求。只能使用[服务帐户身份验证](https://services.docs.unity.com/docs/service-account-auth/)对服务进行身份验证。

## 对玩家进行身份验证##authenticate-players

Logging API 目前不支持玩家身份验证。

## 对受信任的客户端进行身份验证（基本身份验证）##authenticate-trusted-clients-basic-authentication

您可以将 Logging API 与[服务帐户身份验证](https://services.docs.unity.com/docs/service-account-auth/)结合使用。

要访问 [Logging API](https://services.docs.unity.com/observability/v1/)，请使用[基本身份验证](https://services.docs.unity.com/docs/service-account-auth/#using-service-account-credentials)。

1. 导航到 [Unity Dashboard](https://cloud.unity.com)。
2. 选择 **Administration（管理）**> **Service Accounts（服务帐户）**。
3. 选择 **New（新建）** 按钮并输入服务帐户的名称和描述。
4. 选择 **Create（创建）**。

添加产品角色并创建密钥：

1. 选择 **Manage product roles（管理产品角色）**。
2. 从 LiveOps 下拉选单中，选择 **Observability Viewer（可观测性查看者）**。
3. 选择 **Save（保存）**。
4. 选择 **Add Key（添加密钥）**。
5. 使用 base64 编码方式对 **Key ID（密钥 ID）** 和 **Secret key（密钥）** 进行编码。格式为 `<KEY_ID>:<SECRET_KEY>`。
6. 使用此编码值作为请求中的 `Authorization` 标头的值。

请参阅[服务帐户身份验证](https://services.docs.unity.com/docs/service-account-auth/)以了解更多信息。
