> 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/ren-zheng/signed-fetch.md).

# 签名获取

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

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

## 请求头

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

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

传输的链由服务器验证 [如所指定](/contributor/contributor-zh/ren-zheng/authchain.md).

## 请求体

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

## 有效负载

认证链 [负载](/contributor/contributor-zh/ren-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 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://docs.decentraland.org/contributor/contributor-zh/ren-zheng/signed-fetch.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.
