LanguageEnglish
Build →

Learn · QuorumAuth

What is machine-to-machine authentication?

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

Updated

The two stages of M2M authentication

  1. 1Calling service → Authorization serverProves who it isSecret, signed assertion or certificate
  2. 2Authorization server → Calling serviceShort-lived scoped token
  3. 3Calling service → Receiving APIRequest with token
  4. 4Receiving API → Receiving APIVerify with issuer keysCan 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. 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 (RFC 7523) Signature with a private key No shared secret; key never leaves caller Key storage and rotation still matter
Mutual TLS (RFC 8705 for OAuth) Possession of a certificate’s private key Bound to the connection Certificate lifecycle
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 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 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, in place of a shared key.

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.

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 →