> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/api/zh/auth.md).

# 认证

mTLS 证书与用户认证请求头说明

说明 Mini App 合作伙伴服务器 API 的认证方式。

所有 API 都会通过 mTLS（相互 TLS）客户端证书识别调用主体（Mini App）。

mTLS 认证在建立 TLS 连接阶段完成，因此不会出现在请求头中。需要像各 API 文档中的代码示例（cURL·Python·Node.js）那样，将签发的证书和私钥文件一并配置到请求中。

关于防火墙 IP 允许列表、mTLS 证书签发·管理、请求限额等运维信息，请参考服务器 API 使用文档。

用户级 API 需要根据端点一并发送以下值之一。

* `x-toss-user-key` 头部 — 通过 Toss 登录签发的用户密钥（通过获取用户信息 API 获取）
* `x-anon-key` 头部 — 未登录用户识别密钥（通过 Mini App SDK 的 User.getAnonymousKey 函数签发）
* `Authorization: Bearer {accessToken}` 头部 — Toss 登录 Access Token（通过获取 AccessToken API 签发，部分登录 API）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/api/zh/auth.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
