> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/key-concepts/authentication-methods.md).

# Authentication methods

All requests to the CARTO APIs (and therefore all developments using CARTO) must be authenticated. When starting a project or building an application, we recommend choosing one between these three strategies:

* **Authentication via API Access Tokens:** These types of permanent tokens are simple, easy to generate, restrictive, and not tied to specific users. You can use them directly to authenticate your requests. [Read more about API Access Tokens](/carto-for-developers/key-concepts/authentication-methods/api-access-tokens.md).
* **Authentication via Single Page OAuth Client:** Authenticate each user separately by presenting them a login where they need to introduce their CARTO credentials — or their SSO credentials if configured. Once set up, your app will obtain and use [*OAuth Access Tokens*](/carto-for-developers/key-concepts/authentication-methods/oauth-access-tokens.md) for each user independently. [Read more about Single Page Applications](/carto-for-developers/key-concepts/authentication-methods/applications.md#single-page-application-spa).
* **Authentication via Machine-to-Machine OAuth Client:** Obtain an [*OAuth Access Token*](/carto-for-developers/key-concepts/authentication-methods/oauth-access-tokens.md) on demand (using a backend application) without the user having to log in and use it to authenticate all your requests. [Read more about Machine-to-Machine Applications](/carto-for-developers/key-concepts/authentication-methods/applications.md#machine-to-machine-authentication-m2m).

{% hint style="info" %}
If you host your application with **Hosted Apps**, currently in Private Preview, you do not implement any of these flows yourself. CARTO signs the user in and hands your application that user's own OAuth Access Token at runtime, so there is no OAuth client to create and no credential in your code. See [Hosted Apps](/carto-for-developers/key-concepts/hosting-your-application.md) and the [runtime and authentication reference](/carto-for-developers/reference/hosted-apps/runtime-and-authentication.md).
{% 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 by asking a question.

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

```
GET https://docs.carto.com/carto-for-developers/key-concepts/authentication-methods.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.
