LanguageEnglish
Build →

Learn · QuorumAuth

What is a JWT client assertion?

A client assertion, or JWT client assertion, is a short-lived token a client signs with its own private key to prove its identity to an OAuth authorization server, in place of a client secret.

Updated

Authenticating with a signed assertion

  1. 1Client → Authorization serverRegister public key, once
  2. 2Client → ClientSign a fresh assertioniss, sub, aud, exp, jti
  3. 3Client → Authorization serverToken request plus assertion
  4. 4Authorization server → Authorization serverCheck signature, claims, jtijti recorded so replays fail
  5. 5Authorization server → ClientAccess token

Once, the client registers its public key with the authorization server. For each token request the client signs a fresh JWT whose claims are iss, sub, aud, exp and jti, and sends it with the request. The server verifies the signature with the registered key, checks every claim, records the jti, and returns an access token.

No secret is shared: the server holds only a public key, and each short-lived assertion is accepted once.

The simplest way for an OAuth client to authenticate to the token endpoint is a client ID and a client secret. That secret is shared: the server knows it, the client knows it, and anyone who reads it from a config file or a CI log can become the client. A JWT client assertion removes the shared secret. The client holds a private key, the server holds the matching public key, and on each token request the client signs a fresh, short-lived JWT that only it could have produced.

How a JWT client assertion works

RFC 7523, the JSON Web Token profile for OAuth 2.0 client authentication and authorization grants, builds on the assertion framework in RFC 7521. For client authentication the flow is:

  1. Register a public key. The client generates a key pair and registers the public key with the authorization server, directly or as a JWKS URL.
  2. Build the assertion. For each token request the client creates a JWT with these claims:
    • iss: the client ID
    • sub: the client ID
    • aud: the authorization server, typically its token endpoint URL or issuer identifier, both listed in the server’s discovery document, alongside its keys
    • exp: a near expiry, for example 60 seconds ahead
    • jti: a unique ID, so the server can refuse replays
    • optionally iat and nbf
  3. Sign it with the private key, for example with RS256 or ES256, and include the key ID in the kid header.
  4. Send it on the token request.
  5. The server verifies the signature with the registered public key, checks every claim, records the jti, and issues an access token.

The client_assertion_type and client_assertion parameters

Two form parameters carry the assertion on the token request. RFC 7521 (section 4.2) defines them, and RFC 7523 (section 2.2) fixes the value for JWTs:

  • client_assertion_type is always urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
  • client_assertion is the signed JWT itself.

They authenticate the client on any grant type. Here they replace the client secret on a client credentials grant:

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

grant_type=client_credentials
&scope=ledger:write
&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
&client_assertion=eyJhbGciOiJFUzI1NiIsImtpZCI6ImsxIn0.eyJpc3Mi...

The decoded payload:

{
  "iss": "billing-exporter",
  "sub": "billing-exporter",
  "aud": "https://auth.example.com/token",
  "jti": "5b1f0c3e-8d1a-4a7e-9f0b-2c6d1e4f9a10",
  "exp": 1793000060,
  "iat": 1793000000
}

RFC 7523 also defines a second use, the JWT bearer authorization grant, where the JWT itself is the grant (grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer). That is a different job: the assertion represents a subject, not the client.

Client assertion vs client secret, and other methods

With a client secret, every token request carries the secret itself. With a client assertion, it carries a signature that proves the client holds a private key the server never sees. The table adds the other common methods:

Method What is shared with the server Replayable if intercepted Notes
client_secret_basic / client_secret_post The secret itself Yes, until rotated Simplest; weakest
client_secret_jwt An HMAC key Only until exp, and not if jti is tracked Still a shared secret
private_key_jwt (RFC 7523) A public key only Only until exp, and not if jti is tracked No secret on the server
Mutual TLS (mTLS, RFC 8705) A certificate or its CA No; bound to the TLS key See mTLS

The names client_secret_jwt and private_key_jwt come from OpenID Connect Core; RFC 7523 defines the underlying mechanism.

When to use JWT client assertions

Use them for confidential clients and service accounts that today hold a client secret: backends, scheduled jobs, CI pipelines. They suit machine-to-machine authentication wherever mTLS to the authorization server is impractical. They can also authenticate the client on a token exchange request.

If your platform can attest the workload instead, workload identity removes even the stored key.

Pitfalls

  • Long expiries. An assertion valid for an hour is a one-hour bearer token. Keep exp short.
  • No replay check. Without recording jti, a captured assertion can be reused until it expires.
  • Loose audience. Verifiers must check that aud names them. An IETF draft updating RFC 7523 tightens this further, recommending the authorization server’s issuer identifier as the audience.
  • Letting the assertion choose its rights. The server, not the request, decides the scopes a client may hold.
  • Keys that never rotate. Support two registered keys at once so you can roll without downtime.
  • Private keys in source control. Generate keys where the workload runs and register only the public half.

How QuorumAuth handles JWT client assertions

QuorumAuth uses RFC 7523 signed assertions for service accounts whose authority comes from a service role. The assertion is sent through QuorumAuth’s SDK API rather than as a form-encoded client_assertion on a standard token endpoint. In its tested behaviour:

  • The workload generates its key; an administrator registers the public half on the service account, and that becomes the account’s one live key.
  • Each sign-in is a fresh assertion. What the account receives is bounded by its role in its organization, not by what the assertion asks for, and it cannot name an organization where it holds no role.
  • A spent assertion cannot sign in again, and a key the account never registered is refused.
  • Revoking the account, replacing its key, or unbinding its role ends what the key already earned.
  • A service account bound to the deployer role may instead exchange an API key for a bearer limited to that role; an account with a service role is pointed back to its key-bound assertion.

To compare assertions with federated sign-in and API keys for each caller, see service accounts without API keys.

Using private_key_jwt with a hosted identity provider today? Compare service app credentials with attested workload identity.

What is the difference between private_key_jwt and client_secret_jwt?

Both are names from OpenID Connect Core. private_key_jwt signs the assertion with an asymmetric private key; client_secret_jwt signs it with an HMAC of a shared secret. private_key_jwt avoids sharing any secret with the server.

Which claims must a client assertion contain?

For client authentication under RFC 7523, iss and sub set to the client ID, aud identifying the authorization server, and exp. A jti is optional in the RFC but needed if the server is to detect replay.

Is a JWT client assertion the same as an access token?

No. The assertion proves who the client is when it asks for a token. The access token is what the server returns afterwards.

How long should an assertion be valid?

Seconds to a few minutes. It is used once, immediately, so a long expiry only helps an attacker.

What is a JWT assertion?

A signed JWT presented to an authorization server as proof of something. RFC 7523 defines two uses, authenticating the client (a client assertion) and standing in for an authorization grant (the JWT bearer grant).

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 →