1. [Home](https://quorumauth.com/) /
2. [Learn](https://quorumauth.com/learn/) /
3. What is machine-to-machine authentication?

Learn · QuorumAuth

# What is machine-to-machine authentication?

> Machine-to-machine authentication lets services prove who they are to each other. Compare API keys, client credentials, JWT assertions and mutual TLS (mTLS).

Machine-to-machine authentication is how one piece of software proves its identity to another, with no person in the loop.

Updated November 14, 2026

When one program calls another at three in the morning, nobody is awake to type a password. So the program shows the front desk something only it should have, such as a signed letter or a certificate, and the desk hands back a pass that works for a short time and only for certain rooms. The program then shows that pass at each door it knocks on.

On this page

1. How machine-to-machine authentication works
2. The main M2M methods compared
3. When to use which
4. Pitfalls
5. How QuorumAuth handles M2M authentication

The two stages of M2M authentication

1. 1 Calling service → Authorization server Proves who it is Secret, signed assertion or certificate
2. 2 Authorization server → Calling service Short-lived scoped token
3. 3 Calling service → Receiving API Request with token
4. 4 Receiving API → Receiving API Verify with issuer keys Can be local

The calling service proves its identity to the authorization server with a secret, a signature made with its private key, or a certificate. The server returns a short-lived access token carrying the scopes the service may use. The service sends the token with its request, and the receiving API verifies it, which it can do locally against the issuer's published keys.

Prove identity once to get a short-lived, scoped token; the receiving API then checks the token, which it can do locally.

When a person signs in, you can ask them for a password, a code, or a [passkey](https://quorumauth.com/learn/what-is-a-passkey/). When a billing service calls a ledger service at three in the morning, nobody is there to answer. Machine-to-machine (M2M) authentication covers this case: the caller is software, and it has to prove who it is with a credential it can present on its own.

## How machine-to-machine authentication works

Token-based M2M schemes have two stages.

1. **Prove identity.** The calling service presents something only it should have: a secret, a signature made with its private key, or a certificate issued to it.
2. **Receive a token.** An authorization server checks that proof and returns a short-lived access token carrying the scopes the service may use.

The service then sends the token with each request, and the receiving API verifies it, which it can do locally against the issuer’s published keys.

In OAuth 2.0 terms this is the **client credentials grant**, defined in RFC 6749 section 4.4:

```
POST /oauth/token HTTP/1.1
Host: auth.example.com
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=ledger:write
```

How the client authenticates that request is the part that varies most.

## The main M2M methods compared

| Method | What the caller proves | Strength | Main risk |
| --- | --- | --- | --- |
| Static API key | Knowledge of a shared string | Simple | Long-lived, copyable, no binding to caller |
| Client secret (client credentials) | Knowledge of a shared secret | Standardised in OAuth 2.0 (RFC 6749) | Same as API key, but at least yields short tokens |
| [JWT client assertion](https://quorumauth.com/learn/what-is-jwt-client-assertion/) (RFC 7523) | Signature with a private key | No shared secret; key never leaves caller | Key storage and rotation still matter |
| [Mutual TLS](https://quorumauth.com/learn/what-is-mtls/) (RFC 8705 for OAuth) | Possession of a certificate’s private key | Bound to the connection | Certificate lifecycle |
| [Workload identity](https://quorumauth.com/learn/what-is-workload-identity/) | Platform-attested facts about the process | No stored credential at all | Coarse attestation rules |

Read top to bottom, the rows move away from shared secrets, toward keys the caller generates and identities the platform attests. A [SPIFFE](https://quorumauth.com/learn/what-is-spiffe/) identity, for example, can authenticate the token request over mTLS, so the service never stores a secret.

## When to use which

- **Internal services on a platform you control:** workload identity plus mTLS, and short-lived tokens for authorization.
- **A backend calling an external authorization server:** JWT client assertion, or mTLS if the server supports RFC 8705.
- **Legacy integrations that only accept API keys:** keep them, but scope them narrowly, store them in a secret manager, and rotate them on a schedule.
- **A service acting on behalf of a user:** not plain M2M. Use [token exchange](https://quorumauth.com/learn/what-is-oauth-token-exchange/) so the token names both the user and the service.

## Pitfalls

- **One credential for many services.** You lose the ability to tell callers apart and to revoke one without breaking the others.
- **Tokens that last for days.** Short lifetimes are free when renewal is automatic.
- **No audience check.** A token issued for one API should be refused by another. Verifiers must check `aud`.
- **Fail-open verification.** If the verifier cannot reach the revocation source, refusing is safer than accepting.
- **Admin scope by default.** Grant the scopes the job needs, nothing else.

## How QuorumAuth handles M2M authentication

QuorumAuth supports several M2M paths. In its tested behaviour:

- **SPIFFE over mTLS.** A workload presents its SPIFFE identity over mutual TLS and receives an access token immediately. An unregistered SPIFFE ID, or one with no scope grants, is refused, as is a client certificate the server does not trust. The token never outlives the identity that obtained it, and the client refreshes it at a policy fraction of its lifetime.
- **Fail-closed caching.** The token client returns no token when revocation state is unknown, and a token past its grace window is never presented.
- **Key-bound service accounts.** A service account signs in with an assertion signed by its registered key. Its token carries only what its role grants in its own organization; a spent assertion is refused.
- **API keys for deployers.** A service account bound to the deployer role can exchange its API key for an access token limited to that role. Revoking the account, rotating its key, or unbinding the role ends those sessions.
- **Local verification and revocation.** Services verify tokens locally without a round trip, and a revoked token is rejected once the SDK sees the revocation, even when it cannot reach the authority.

The result is [a scoped, revocable credential for every service, job and script](https://quorumauth.com/solutions/machine-to-machine-authentication-platform/), in place of a shared key.

## Frequently asked questions

What is the standard M2M authentication method?

In OAuth 2.0 it is the client credentials grant (RFC 6749 section 4.4), where a service exchanges its client credentials for an access token. API keys are simpler but weaker.

Are API keys good enough for M2M?

They work, but they are long-lived bearer secrets with no binding to the caller. Prefer key-bound or attested credentials that yield short-lived tokens.

Do I need both mTLS and tokens?

They do different jobs. mTLS proves which workload is on the connection; a token carries scopes and can travel through proxies the TLS session does not cross.

How long should an M2M token live?

Minutes, not days. The client renews it automatically, so a short lifetime costs nothing but limits what a leaked token is worth.

## Related reading

[Learn QuorumAuth What is workload identity?Workload identity lets software prove who it is from where and how it runs, so services stop sharing static API keys and passwords.Read](https://quorumauth.com/learn/what-is-workload-identity/) [Learn QuorumAuth What is a JWT client assertion?A client assertion is a signed JWT an OAuth client sends instead of a client secret. How RFC 7523 works, the client\_assertion\_type value, and what to check.Read](https://quorumauth.com/learn/what-is-jwt-client-assertion/) [Learn QuorumAuth What is mTLS?Mutual TLS makes both client and server present certificates, so each side proves its identity before any data flows. How it works and where it fails.Read](https://quorumauth.com/learn/what-is-mtls/) [Learn QuorumAuth What is a non-human identity?A non-human identity (NHI) is an identity software uses to act without a person: service accounts, workloads, API keys, bots. Examples, risks and controls.Read](https://quorumauth.com/learn/what-is-non-human-identity/) [Learn QuorumAuth What is SPIFFE?SPIFFE gives every workload a verifiable identity, so services authenticate each other with short-lived certificates instead of shared secrets.Read](https://quorumauth.com/learn/what-is-spiffe/) [Learn QuorumAuth What is OAuth token exchange?OAuth 2.0 token exchange (RFC 8693) trades one token for another with a new audience or narrower scope. Delegation, impersonation, and examples.Read](https://quorumauth.com/learn/what-is-oauth-token-exchange/) [Guides QuorumAuth Run service accounts without a stored API key Stop storing API keys for CI jobs and services. Exchange a token your OIDC issuer already mints, or sign one-time assertions with a key that never leaves.Read](https://quorumauth.com/guides/service-account-without-api-key/)

## Talk to sales about QuorumAuth.

QuorumAuth is sold through our sales team. The Build page shows the drop-in sign-in on your origin and how to reach sales about your stack.

[Go to Build and contact sales →](https://quorumauth.com/onboarding/)
