# BasicAuthCredential 类 (/zh-CN/api-reference/cloud-recording/go-api/basicauthcredential.go)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<a id="newbasicauthcredential"></a>
## NewBasicAuthCredential [#newbasicauthcredential]

```go
func NewBasicAuthCredential(username string, password string) *BasicAuthCredential
```

创建一个新的 [`BasicAuthCredential`](/zh-CN/api-reference/cloud-recording/go-api/basicauthcredential.go) 实例。

:::info[信息]
自 v0.7.0 版本新增。
:::

:::warning[注意]
客户 ID 和客户密钥从声网控制台获取，用于 HTTP 基本身份验证。
:::

#### 参数 [#参数]

| 参数 | 数据类型 | 描述 |
| --- | --- | --- |
| `username` | `string` | 从声网控制台获取的[客户 ID](/zh-CN/introduction/glossary#客户-id-和客户密钥)。 |
| `password` | `string` | 从声网控制台获取的[客户密钥](/zh-CN/introduction/glossary#客户-id-和客户密钥)。 |

#### 返回值 [#返回值]

`*BasicAuthCredential`：返回 [`BasicAuthCredential`](/zh-CN/api-reference/cloud-recording/go-api/basicauthcredential.go) 实例。
