> For the complete documentation index, see [llms.txt](https://asyncher.convertino.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asyncher.convertino.cloud/what-i-need-to-do/authorization-and-security.md).

# Authorization & Security

<figure><img src="/files/yJRHuP1BAOpdDawfRZNb" alt=""><figcaption></figcaption></figure>

If, [after configuring the two endpoints](/what-i-need-to-do/call-the-api.md#server-side), you need to allow Asyncher to communicate with credentials/token to the server, doing so is very simple.&#x20;

Asyncher does not need any configuration and does not care about the type of authorization you have developed on your backend. The client will directly send to it the credentials. Look at this example:

```dart
void callAsyncherExample(url, data, token) async {
  // Fetch all data
  List<ExampleData> allData = getAllData();
  
  // Send http request to Asyncher with the data encoded in json
  final response = await http.post(
    url,
    headers: {
      'Authorization': 'Bearer ${token}',
      'Content-Type': 'application/json'
    },
    body: jsonEncode(data)
  );
  
  // Update database with synchronized data
  deleteAllData();
  insertAllData(response.body);
}
```

This is a usual call to Asyncher with the difference that the `Authorization` field has been added to the header. Asyncher looks to see if there is an `Authorization` field in the header of the request made by the client and then uses it to make requests to [`pull_url`](/features/configuration.md) and [`push_url`](/features/configuration.md).

{% hint style="info" %}
If you have developed a security that does not use the `Authorization` field in the header, [please don't hesitate to let me know](https://github.com/matteo-convertino/asyncher/issues). &#x20;
{% endhint %}


---

# 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://asyncher.convertino.cloud/what-i-need-to-do/authorization-and-security.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.
