Sobes.tech
Middle

What are the purposes of the 'exp' and 'aud' fields in JWT?

sobes.tech AI

Answer from AI

In JWT (JSON Web Token), the exp (expiration) field indicates the token's expiration time. This allows the server to determine that the token is no longer valid after the specified time, enhancing security.

The aud (audience) field defines the recipient of the token — that is, which service or application the token is intended for. This helps ensure that the token is used only by the systems for which it was issued, preventing misuse.

Example of usage:

{
  "exp": 1716239022,  // time in UNIX timestamp format
  "aud": "myapp_client"
}
What are the purposes of the 'exp' and 'aud' fields… - sobes.tech