Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Kinde · Const

M2M application

An M2M application authenticates backend services, scripts, or automation tools without a user. It uses OAuth 2.0 client credentials to obtain access tokens for Kinde APIs or your own APIs.

How it works

An M2M application represents a backend service, script, or automation tool rather than a person. It uses OAuth 2.0 client credentials: the service sends its client ID and secret, receives an access token, and uses that token for authorized API calls.

Syntax

POST /oauth2/token with grant_type=client_credentials, client_id, client_secret, and audience

Parameters

NameTypeDescription
client_idstringThe application's client identifier issued by Kinde.
client_secretstringThe application's secret issued by Kinde.
grant_typestringOAuth grant requested by the client; use client_credentials.
audiencestringThe API the token is intended to access.

Returns

An OAuth access token that can be sent as a bearer token to an authorized API.

Key points

  • Use an M2M application when a non-user workload must authenticate to an API.
  • The authentication mechanism is OAuth 2.0's client credentials flow.
  • The resulting access token can authorize calls to Kinde APIs or your own backend.
  • An M2M app can be broadly available or restricted to one organization.

Example: Request a token and call an API

const tokenResponse = await fetch(`https://${process.env.KINDE_DOMAIN}/oauth2/token`, {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({
    grant_type: "client_credentials",
    client_id: process.env.KINDE_CLIENT_ID!,
    client_secret: process.env.KINDE_CLIENT_SECRET!,
    audience: process.env.API_AUDIENCE!
  })
});

if (!tokenResponse.ok) throw new Error("Token request failed");
const { access_token } = await tokenResponse.json();

const apiResponse = await fetch(`${process.env.API_URL}/records`, {
  headers: { Authorization: `Bearer ${access_token}` }
});

console.log(await apiResponse.json());

The service exchanges its M2M credentials for an access token, then presents that token when calling the protected API.

When to use it

Backend automation

A server needs to call a protected backend API on a schedule.

CLI tooling

A command-line tool needs non-interactive API access.

IoT and daemon workloads

A device or daemon must authenticate without a user session.

Management API integration

A service needs scoped access to the Kinde Management API.

Interview questions

QWhat is an M2M application and how does it authenticate?

An M2M application authenticates a backend service, script, or automation tool without a user. It uses the OAuth 2.0 client credentials grant to exchange its client ID and client secret for an access token.

Follow-up: How would you limit its authority? Authorize the application for only the required API and grant the smallest necessary scopes.

QWhat setup is required before an M2M app can call an API?

First create the application, then authorize it for the APIs it may call. The service sends its credentials in a client-credentials token request and uses the returned bearer token to call the API.

Follow-up: What must be configured before token use? The target API must be authorized for the M2M app, and the request must identify the intended API audience.

QWhen should you use an M2M application?

M2M apps suit backend services, CLIs, daemons, IoT devices, and automation because they operate without user interaction. Each app can be dedicated to a service or other machine identity.

Follow-up: Why use one app per service or environment? Separate credentials reduce blast radius and make least-privilege authorization and auditing clearer.

  • OAuth 2.0 client credentials flow
  • Client ID
  • Client Secret
  • access token
  • API authorization
  • scopes
  • Kinde Management API
  • organization

Source: M2M overview. Checked 2026-10-15.