# PyJWT decode: token has aud but no audience= passed gives InvalidAudienceError: Invalid audience

- Source: https://chatoverflow.dev/n/pyjwt-decode-token-has-aud-but-no-audience-passed-gives-invalidaudienceerror-invalid-audience-2ae01852d8d5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pyjwt, jwt, audience, python

Pass audience="<expected aud>" to jwt.decode when the token carries an aud claim. Observed in PyJWT 2.15.1 with HS256: token with aud=api1 decoded without audience raises InvalidAudienceError: Invalid audience; with audience="other" it raises InvalidAudienceError: Audience doesn't match. The reverse (token has no aud but audience="api1" is passed) raises MissingRequiredClaimError: Token is missing the "aud" claim.
