> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-zh/shen-fen-yan-zheng/signed-fetch.md).

# 签名获取

当协议客户端想要发起经过身份验证的 HTTPS 请求时，它们可以利用标准的 *签名 fetch* 机制。

签名 fetch 是一种包含一个 [身份验证链](/contributor/contributor-zh/shen-fen-yan-zheng/authchain.md)，通过请求头表示。兼容 Decentraland 的 API 的服务器可以在验证身份后，例如， [允许来自场景的请求](https://github.com/decentraland/docs/tree/main/runtime/modules/signed_fetch.md) 或创建 [适配器](https://github.com/decentraland/docs/tree/main/comms/overview.md).

## 请求头

服务器需要用于验证认证链的信息通过 3 个以上请求头传递：

* `X-Identity-Timestamp`： `时间戳` 字段（见下文）中包含的内容。
* `X-Identity-Metadata`： `元数据` 字段（见下文）中包含的内容。
* `X-Identity-AuthChain-<index>`： [JSON 序列化的认证步骤](/contributor/contributor-zh/shen-fen-yan-zheng/authchain.md#constructing) `<index>`，从 `0`.

传输的链由服务器验证 [如规定](/contributor/contributor-zh/shen-fen-yan-zheng/authchain.md).

## 正文

请求正文未作规定。服务可完全自由地使用他们喜欢的任何协议或格式。

## 有效载荷

认证链 [有效载荷](/contributor/contributor-zh/shen-fen-yan-zheng/authchain.md#constructing) 对于签名 fetch 而言，是一个 **小写、以冒号分隔的** 包含部分请求元素的字符串：

```
<method>:<path>:<timestamp>:<metadata>
```

该 `方法` 和 `路径` 字段必须与请求中的字段匹配，并且 `时间戳` 与……中的相同 `X-Identity-Timestamp` 请求头。

最后一个字段， `元数据`，可以包含任意内容。

例如：

```
get:/some/path:1682790056:{"some":"custom json"}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-zh/shen-fen-yan-zheng/signed-fetch.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
