Applications

Applications are entities that belong to your CARTO organization. They usually represent a project, and they also provide a method to authenticate that project, as well as technical configuration for that method (eg: callback url, allowed urls...). Applications are visible by the entire organization by default, but only the user that created the application can edit or delete it.

There are two types of applications: Single-Page Applications (SPA) and Machine-to-Machine Applications (M2M).

Single Page Application (SPA)

Single Page Applications (usually referred to as SPAs) obtain OAuth Access Tokens for each user by presenting a login flow where the user introduces their CARTO credentials. This login flow can be the CARTO default login, or your own SSO login if it's been configured for the organization and the app.

After each user successfully logs in, the app will obtain a short-lived OAuth Access Token that you can use through your app.

How to create a Single Page Application

  1. Open your CARTO Workspace and navigate to the "Developers" section

  2. Then, click on "Create new" under "Built applications"

  3. Make sure to select "Single Page Application". Read more about how to create applications.

When to use SPA authentication

Machine to Machine authentication (M2M)

Machine to Machine applications (usually referred to as M2M) obtain OAuth Access Tokens on demand, using the client_secret of the application to request them.

It doesn't require a login flow where the user needs to type the password to get a token.

How to create a M2M Application

  1. Open your CARTO Workspace and navigate to the "Developers" section

  2. Then, click on "Create new" under "Built applications"

  3. Make sure to select "Machine to Machine". Read more about how to create applications.

Requesting an OAuth Access Token using your M2M Application

Here's an example of a cURL request using your application's client_secret and client_id

curl --request POST \
  --url 'https://auth.carto.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=client_credentials' \
  --data 'client_id={{clientID}}' \
  --data 'client_secret={{clientSecret}}' \
  --data 'audience=carto-cloud-native-api'

When to use M2M Authentication

Machine-to-Machine is only available for Enterprise Large plans and above. Please get in touch at [email protected] if you’re interested in this feature.

Last updated

Was this helpful?