> 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-pt/autenticacao/signed-fetch.md).

# Fetch Assinado

Quando clientes de protocolo querem fazer requisições HTTPs autenticadas, eles podem aproveitar o padrão *signed fetch* mecanismo.

Um signed fetch é requisição que inclui um [auth\_chain](/contributor/contributor-pt/autenticacao/authchain.md), representado através de headers. Servidores com APIs compatíveis com Decentraland podem validar identidades antes, por exemplo, de [permitir requisições de cenas](https://github.com/decentraland/docs/blob/main/runtime/modules/signed_fetch.md) ou criar [adapters](https://github.com/decentraland/docs/blob/main/comms/overview.md).

## Headers

A informação que o servidor precisa para validar a cadeia de autenticação é retransmitida em 3+ headers:

* `X-Identity-Timestamp`: o `timestamp` campo incluído no payload assinado (veja abaixo).
* `X-Identity-Metadata`: o `metadata` campo incluído no payload assinado (veja abaixo).
* `X-Identity-AuthChain-<index>`: o [etapa de autenticação serializada em JSON](/contributor/contributor-pt/autenticacao/authchain.md#constructing) `<index>`, começando de `0`.

A cadeia transmitida é validada pelo servidor [conforme especificado](/contributor/contributor-pt/autenticacao/authchain.md).

## Body

O corpo da requisição não é especificado. Serviços têm plena flexibilidade para usar quaisquer protocolos ou formatos que desejarem.

## Payload

A cadeia de autenticação [payload](/contributor/contributor-pt/autenticacao/authchain.md#constructing) para um signed fetch é um **lower-case, colon-separated** string que inclui alguns dos elementos da requisição:

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

O `method` e `path` campos devem corresponder aos da requisição, e `timestamp` é o mesmo que no `X-Identity-Timestamp` header.

O último campo, `metadata`, pode ter conteúdo arbitrário.

Por exemplo:

```
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:

```
GET https://docs.decentraland.org/contributor/contributor-pt/autenticacao/signed-fetch.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.
