RFC 8705 — OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
Gap (candidate for FAPI track)
Source: docs/oauth/RFC_8705.md
RFC 8705 — OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens ¶
Status: Standards Track
Published: 2020-02
L-tier / T-tier: L5 · T5 (auth + mint binding) + T6 (present) + T7 (verify binding)
OneAuth coverage: Gap (#335). FAPI 2.0 is met with DPoP instead (OneAuthConfig.FAPI2)
See also:RFC_9449.md·RFC_7523.md·LANDSCAPE.md
In one sentence ¶
RFC 8705 does two things — it authenticates clients at /token via the
TLS client certificate they present (no client_secret), and it binds the
issued access token to that certificate so a stolen token can’t be replayed
without the matching private key.
What problem does it solve? ¶
| Without 8705 | With 8705 |
|---|---|
| Bearer access tokens replay from anywhere they leak (logs, proxies, caches) | Token is bound to a TLS cert — useless without the cert’s private key |
Client authentication relies on shared secrets (client_secret_basic) or asymmetric JWT (private_key_jwt) |
TLS cert IS the credential — proof of possession built into the transport |
| Sender constraint for confidential clients requires a separate proof layer per request | mTLS handles both auth and binding at the transport layer — zero per-request overhead |
| FAPI deployments need a strict client-auth + sender-binding combo | mTLS + cert-bound tokens is one of two FAPI-approved paths (the other is DPoP) |
8705 is the “FAPI-grade with PKI infrastructure” answer. For deployments
that already have a CA pipeline (banks, healthcare, government), mTLS
makes the most operational sense — extend the existing cert plumbing into
the OAuth surface.
Relatable example ¶
UK Open Banking, EU PSD2, and similar regulated APIs require strong client
authentication AND sender-constrained tokens. A bank’s third-party
integrator (e.g., a budgeting app) holds a cert issued by a regulator-
trusted CA. On every call:
- App’s outbound TLS handshake presents the cert.
- The AS validates the cert chain, treats
sub_dnas the client identifier,
issues an access token withcnf.x5t#S256= thumbprint of the cert. - App calls the RS; TLS again presents the cert; RS verifies the
cnf.x5t#S256claim against the actual TLS cert thumbprint. - If the cert is missing, expired, or replaced, the token is rejected.
This is the gold-standard binding model for high-stakes APIs. The cost is
PKI complexity — but for organizations that already run PKI (banks,
governments), the marginal cost is zero.
Key concepts ¶
- Two client authentication methods:
tls_client_auth(§2.1): cert chain back to a recognized CA, with
a registered “expected” subject DN or SAN. AS validates chain
against trusted roots. The PKI-rich deployment path.self_signed_tls_client_auth(§2.2): client presents a
self-signed cert; AS matches the cert’s thumbprint against one
published in the client’sjwks/jwks_uri. The “I have a cert
but no CA” path. Operationally closer toprivate_key_jwt.
- Certificate-bound access tokens (§3): independent of how the client
authenticated, the issued access token carries
cnf.x5t#S256= SHA-256 thumbprint of the cert used at issuance. cnf.x5t#S256validation at the RS (§3.2): on every request, the
RS extracts the TLS cert thumbprint and compares against thecnf
claim. Mismatch → reject. This is where the sender constraint
actually does its job.- Discovery advertisement:
tls_client_certificate_bound_access_tokens: truein AS metadata
(RFC 8414)mtls_endpoint_aliasesfor ASes that segregate mTLS-only endpoints
- MTLS endpoint aliases pattern — some ASes serve mTLS on different
hostnames or ports (e.g.,mtls.as.example.com:443) to keep TLS
termination separate. Themtls_endpoint_aliasesmetadata field
advertises these alternative paths.
Wire example ¶
Setup — client registers (or self-publishes) its cert:
For tls_client_auth, registration includes one or more of:
tls_client_auth_subject_dn— “CN=acme-client, O=Acme Corp”tls_client_auth_san_dns—acme-client.example.comtls_client_auth_san_uri,tls_client_auth_san_ip,tls_client_auth_san_email
For self_signed_tls_client_auth, the client publishes its cert (or
thumbprint) in its jwks / jwks_uri.
Token mint — client presents cert via TLS, AS issues bound token:
POST /api/token HTTP/1.1
Host: mtls.as.example.com (mTLS-only endpoint)
Content-Type: application/x-www-form-urlencoded
[client certificate presented in TLS handshake; no Authorization header]
grant_type=client_credentials
&scope=read+write
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "eyJhbGciOi...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "read write"
}
The issued JWT carries:
{
"iss": "https://as.example.com",
"sub": "acme-client",
"aud": "https://api.example.com",
"exp": 1750000000,
"iat": 1749996400,
"client_id": "acme-client",
"scope": "read write",
"cnf": {
"x5t#S256": "AaXf2WnsoFn7zCUcr3...thumbprint-of-the-cert"
}
}
Resource access — RS verifies cert thumbprint matches cnf:
GET /api/me HTTP/1.1
Host: api.example.com
Authorization: Bearer eyJhbGciOi...
[client certificate presented in TLS handshake]
RS algorithm:
- Parse and verify JWT signature.
- Extract
cnf.x5t#S256claim. - Compute SHA-256 thumbprint of the actual TLS client cert.
- Compare. Mismatch → 401.
Where it lands on the OAuth abstraction ¶
- L5 client auth strength (slot 1) + L5 token sender constraint
(slot 2). 8705 fills both with one mechanism. - T5 (issue / mint binding) + T6 (present cert) + T7 (verify
binding). Cross-cuts the runtime path more than most RFCs. - Sibling spec at the same slot: RFC 9449 DPoP — same
property (sender constraint) via app-layer crypto rather than TLS.
Choose one based on deployment topology, not security level (both are
equivalent at FAPI 2.0).
OAuth 2.0 status ¶
Published 2020. Adopted in regulated deployments (Open Banking, Open
Finance, government APIs). Niche outside FAPI-style profiles — most consumer
OAuth deployments don’t have PKI to plug into.
OAuth 2.1 status ¶
Not mandated by 2.1. Optional. FAPI 2.0 (which builds on 2.1) requires
one of mTLS or DPoP — pick by deployment topology.
Migration path (bearer → mTLS-bound) ¶
This is a heavier lift than the L0/L1 migrations because PKI
infrastructure isn’t always there. If you’re starting from
client_secret_basic and want to add mTLS:
- Decide cert sourcing — PKI (CA-issued) vs self-signed-with-JWKS.
Self-signed is operationally similar toprivate_key_jwt— easier path
if you don’t already run a CA. - Stand up mTLS endpoint termination — typically via a reverse proxy
(nginx, envoy) that handles TLS and forwards client cert via a
trusted header (X-Client-Cert). The AS process reads the header. - Decide endpoint segregation — separate
mtls.as.example.com
hostname OR same hostname with mTLS-optional. Most prefer
segregation. - Add
cnf.x5t#S256claim to issued tokens when the client used
mTLS to authenticate. - RS-side: validate cert thumbprint against
cnfon every request. - Update AS metadata with
tls_client_certificate_bound_access_tokensand
mtls_endpoint_aliases.
The PKI side dominates effort; the OAuth wire changes are small.
When NOT to use it ¶
- No PKI infrastructure: DPoP (RFC 9449) gives the same sender
constraint without certificate management. - Public clients (mobile, SPA): they can’t reliably hold a TLS client
cert. DPoP is the right answer for these. - Behind a TLS-terminating proxy you don’t control (some PaaS): you
may not see the client cert. Either negotiate cert forwarding with the
PaaS or switch to DPoP. - Simple internal services on a trusted network: mTLS adds operational
overhead without solving a problem you have.
OneAuth status ¶
| 8705 surface | Status | Where (grep-verified) | Notes |
|---|---|---|---|
tls_client_auth client auth method (§2.1) |
Gap | No mTLS handlers in apiauth/; the AdminAuth row of admin/DESIGN.md mentions mTLS as a future admin authenticator (unrelated to OAuth client auth) |
Tracked in #335. FAPI 2.0 accepts MTLS or DPoP, and oneauth meets it with DPoP through OneAuthConfig.FAPI2 (0.1.52) and the reference server’s fapi2: true (0.1.54), so MTLS is optional there |
self_signed_tls_client_auth (§2.2) |
Gap | — | Lower-PKI path; operationally similar to private_key_jwt |
cnf.x5t#S256 claim emission on issued tokens |
Gap | — | The actual sender-binding mechanism |
RS-side cnf.x5t#S256 validation |
Gap | — | Symmetric to emission |
tls_client_certificate_bound_access_tokens AS metadata field |
Gap | apiauth/as_metadata.go lacks this field; would need adding |
Discovery advertisement |
mtls_endpoint_aliases AS metadata field |
Gap | — | For deployments with segregated mTLS endpoints |
DCR client metadata fields (tls_client_auth_subject_dn, etc.) |
Gap | admin/dcr.go DCRRequest doesn’t carry these fields |
Required for client registration when using tls_client_auth |
Implementation sketch. When this lands, the cleanest shape is:
- A new
ClientAuthenticatorstrategy alongside the existing
client_secret_*/private_key_jwt/client_secret_jwtflavors,
reading the cert fromr.TLSwhen oneauth terminates TLS. Behind a
TLS-terminating proxy the cert arrives in a header such as
X-Client-Cert, and that would need an explicit trusted-proxy rule:
since 0.1.52 oneauth takes nothing security-relevant from forwarded
headers (client-assertion audiences and DPoPhtuboth ignore them),
because any caller can send them. - A
cnf.x5t#S256emission and verification path beside DPoP’s. DPoP
has its ownDPoPProofValidator(apiauth/dpop.go) andcnf.jkt
binding; no shared token-binding interface exists, and adding MTLS
would mean either one or a second parallel path. - AS metadata fields added incrementally — opt-in per deployment.
FAPI 2.0 conformance does not depend on this work, since the DPoP path
already covers it. MTLS would matter for deployments whose clients
already hold certificates.
Related RFCs ¶
- RFC 9449 — DPoP; the sibling sender-constraint mechanism for non-PKI deployments
- RFC 7523 — JWT bearer client auth; the asymmetric-key alternative when you have neither PKI nor DPoP
- RFC 9068 — JWT AT profile; the issued tokens carry
cnf.x5t#S256as a standard claim - RFC 9700 — §4.10 names sender constraint as the defense; doesn’t pick between mTLS and DPoP
- FAPI 1.0 / 2.0 — the profile that mandates one of mTLS or DPoP
- RFC 7800 — defines
cnfclaim semantics