# 身份认证

ISP 支持与网关产品相同的两种认证模式，但接线方式不同——没有网关，认证发生在每个 IP 上。

## 模式 A — 用户名 + 密码（默认）

清单里每个 IP 共用同一用户名与密码。当作普通 HTTP 代理传入即可：

```bash
curl -x http://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 \
     https://example.com
```

客户端会把 `helo_s1a2b3c4d5e:PASSWORD` 做 Base64 编码后发送：

```
Proxy-Authorization: Basic aGVsb19zMWEyYjNjNGQ1ZTpQQVNTV09SRA==
```

**优点**

* 任意来源 IP 都可用，无需提前部署
* 整批共用同一凭证，加载与轮换简单

**缺点**

* 凭证存在于代码或配置中

## 模式 B — IP 白名单

在控制台一次性登记出口 IP。来自这些 IP 的请求访问你的 ISP 代理时无需 `Proxy-Authorization` 头。

```bash
curl -x http://198.51.100.42:8000 https://example.com
```

（注意：完全无用户名密码——**源 IP 即身份**。）

开启方式：

1. **控制台 → ISP → 我的 IP → {批次} → IP 白名单**。
2. 添加最多 50 个 IPv4 地址或 CIDR 网段。**白名单按批次维度**，不是按 IP——添加一条即授权该来源访问该批次的所有 IP。
3. 修改 60 秒内生效。

> 每个批次有各自的白名单。把 IP 加到批次 A 不会授权它访问批次 B。

**优点**

* 代码中无密钥
* 请求更简洁——光秃秃的 URL

**缺点**

* 出口 IP 动态的客户端（笔记本、无 NAT 网关的容器）不适用

## 如何选择

| 场景            | 推荐                  |
| ------------- | ------------------- |
| 出口 IP 固定的服务器  | IP 白名单              |
| 走 NAT 出口的容器集群 | IP 白名单（NAT IP）      |
| 笔记本 / 动态出口    | 用户名 + 密码            |
| 反检测浏览器集群      | 用户名 + 密码（工具本来就要存凭证） |

## 整批凭证轮换

整批轮换密码：

1. **控制台 → ISP → 我的 IP → {批次} → 轮换密码**。
2. 新密码 60 秒内生效。
3. 旧密码立即失效。
4. 重新下载清单。

用户名**不可轮换**——它是子账号标识，对批次是永久的。

## API

白名单与轮换也可通过 API 操作：

* [白名单 API](/helodata-zh/api-can-kao/whitelists.md)（`product=isp`、`batch_id=...`）
* [订单 API](/helodata-zh/api-can-kao/orders.md)（轮换接口）


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helodata.com/helodata-zh/chan-pin/overview-2/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
