← Concepts

阅读中文版本

Access Token Audience Binding

Audience binding restricts a token to the resource server it was minted for, preventing a token issued for service A from being replayed against service B in a shared token pool.

security

Definition

Audience binding embeds the intended recipient (aud claim or resource indicator) in an access token so that a resource server rejects tokens minted for a different audience, closing the token-replay window across services that share a token type or issuer.

Context and scope

Applied in OAuth 2.0 token exchange, multi-audience APIs, and zero-trust service meshes where a single issuer signs tokens for many backends.

Common misconceptions

  • A token signed by the same issuer is safe to accept anywhere — the issuer is shared, the audience is what scopes the trust
  • Scopes alone replace audience — scopes authorize an action, audience identifies the recipient, and conflating them lets a token hop services

Anti-patterns

  • Issuing single-audience tokens to a web client that calls many APIs, forcing a token exchange on every hop
  • Accepting tokens without checking aud because the issuer is trusted, leaving the replay window open

Related concepts

Authoritative source

https://datatracker.ietf.org/doc/html/rfc8707

What it is

Audience binding embeds the intended recipient (aud claim or resource indicator) in an access token so that a resource server rejects tokens minted for a different audience, closing the token-replay window across services that share a token type or issuer. Applied in OAuth 2.0 token exchange, multi-audience APIs, and zero-trust service meshes where a single issuer signs tokens for many backends. The threat model determines which controls apply: preventive controls block exploits, detective controls surface violations, and corrective controls restore integrity after an incident.

How it works

Effective implementations layer controls so that no single bypass compromises the asset. Verification happens at trust boundaries, not just at the perimeter. Cryptographic primitives are selected for the concrete property needed — unforgeability, indistinguishability, or non-malleability — and never composed ad hoc. Failure modes fail closed: a verification error denies rather than allows.

When to enforce and pitfalls

Enforce wherever an attacker can influence input that crosses a trust boundary. Common pitfalls include treating obfuscation as a control, relying on secrecy of the algorithm rather than the key, and auditing the happy path while ignoring error-handling branches where bypasses often hide. Rate-limit and log every verification attempt so brute-force and oracle attacks become visible.