What is jwt audience
Last updated: April 1, 2026
Key Facts
- The audience claim is represented by the 'aud' key in the JWT payload and contains a string or array of strings identifying the intended recipient(s)
- The audience validation is a security measure that prevents a token intended for one service from being accepted and used by a different service
- When a token includes an audience claim, the receiving service should verify that its identifier matches one of the values in the 'aud' claim before accepting the token
- The audience value typically contains a URI, service name, or unique identifier such as 'https://api.example.com' or 'example-mobile-app'
- If a token does not include an audience claim, the receiving service must decide whether to require it or accept the token unconditionally
Overview
The audience (aud) claim in a JWT token is a security feature that specifies which service, application, or principal the token is intended for. This claim serves as a verification mechanism, ensuring that tokens are only accepted by their intended recipients. The audience validation is particularly important in distributed systems where multiple services accept JWT tokens, as it prevents token reuse across unauthorized contexts.
Audience Claim Structure
The audience claim appears in the JWT payload as the 'aud' key with a value that identifies the intended recipient. The value can be a single string, such as 'https://api.example.com' or 'mobile-app-client', or an array of strings representing multiple intended recipients. The audience identifier is typically unique and specific to each service or application. It should be chosen carefully to be distinctive and unambiguous, preventing confusion between similar services or accidentally granting access to the wrong recipient.
Audience Validation
When a service receives a JWT token, it should validate the audience claim by checking whether its own identifier appears in the token's 'aud' value. If the audience claim exists but doesn't match the service's identifier, the token should be rejected. This validation ensures that a token issued for Service A cannot be misused by Service B, even if Service B has the issuer's public key. Audience validation is especially critical in scenarios where multiple services share the same issuing authority or public key.
Use Cases and Scenarios
Audience validation is essential in multi-service architectures, APIs with multiple endpoints, single sign-on systems, and microservices environments. For example, a company might issue a single JWT token that's valid for multiple services, but each service should validate that the audience includes its identifier. In mobile applications, the audience might specify whether a token is intended for the Android app, iOS app, or web client. This granular control prevents token misuse if a token is compromised or leaked.
Best Practices
Always include an audience claim in JWT tokens unless there's a specific reason not to. Define audience values clearly and consistently across your organization. Each service should validate the audience claim on every token it receives. Use unique, descriptive identifiers that clearly indicate the intended recipient. When issuing tokens for multiple recipients, include all intended audience values in an array. Document your audience strategy to ensure developers implementing token validation understand and apply it correctly.
Related Questions
What other claims are included in a JWT token?
Common JWT claims include 'sub' (subject/user ID), 'iss' (issuer), 'exp' (expiration time), 'iat' (issued at), 'jti' (JWT ID), and custom claims containing application-specific data.
What happens if a token doesn't include an audience claim?
If the 'aud' claim is absent, the receiving service must decide whether to require it, reject the token, or accept it unconditionally based on its security policy.
Can a JWT token have multiple audience values?
Yes, the 'aud' claim can be an array containing multiple values, allowing a single token to be valid for multiple intended recipients or services.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- RFC 7519 - JWT Audience ClaimPublic Domain
- Wikipedia - JSON Web TokenCC-BY-SA-4.0
- JWT.io - JSON Web TokensMIT