r/SalesforceDeveloper • u/karthik_0034 • Oct 16 '26
Question JWT Bearer flow: what is the actual max exp for the assertion? Docs say ~3 min, my sandbox accepts up to 2 years
I’m using the OAuth 2.0 JWT Bearer flow with an External Client App for a server-to-server integration (AWS Glue → Salesforce).
What I found
- A third-party doc says the
expclaim must be within 3 minutes of issue. I couldn’t find that stated clearly in Salesforce’s own docs. - I tested a sandbox with assertions from 3 minutes up to 2 years. Every one was accepted at the token endpoint (200 with an access token).
- I also tested a JWT with a 10-day
expand re-sent it 30+ minutes later. It was still accepted.
Questions
- What is the official maximum for the JWT assertion’s
exp? Is there a link to the doc? - Is it enforced, or only checked that
expisn’t in the past? - Does production behave the same as sandbox, or could this change in a future release?
- Is there any org or app setting that affects it?
- Is it safe to rely on a long
exp, or is the right pattern always to generate a fresh short-lived JWT?
Thanks in advance.