If your org has many integrations and depends on them, you might want to check whether any of them could be affected by this update: Salesforce is now expiring OAuth refresh tokens that go unused for 30 days.
This change came with the Winter ‘27 release, and its enforcement started rolling out in sandboxes on October 21; for production orgs, that started November 4. In this article, we’ll cover what’s changing, how to check if your org is at risk, and what to do when something breaks due to this update.
At a Glance
Refresh tokens that go unused for 30 days now expire, and every use of the token restarts the 30-day clock.
This applies to connected apps as well as external client apps, so if you have integrations that rely on a stored refresh token, you might want to recheck that. This isn’t entirely new, as Salesforce required partner apps to comply by May 11, 2026.
What Is a Refresh Token?
If you’re unsure what to check, let’s start with the basics. A refresh token is the “remember me” login that lets an app keep talking to Salesforce without a person signing in again. When an app connects through OAuth, it gets a short-lived access token for API calls and a refresh token it can trade for a new access token when the first one runs out.
Until now, many refresh tokens effectively lasted until someone revoked them. Admins could even set a policy of “valid until revoked”, so plenty of integrations were built assuming the token would never expire. However, that policy is no longer valid once the 30-day limit is enforced.
What’s Changing?
And when? Well, Salesforce is rolling out a 30-day idle limit on refresh tokens, starting with sandboxes (rolling out since October 21) and following in production (rolling out since November 4).
On the day enforcement turns on for an org, any refresh token that has already been idle for 30 days or longer expires immediately, along with its access token. After that, tokens expire once they hit 30 days of inactivity. Because the rollout is ongoing, your org may not see the change on the exact date.
There are two more related changes to this, which are the OAuth username-password flow retirement (moved to February 20, 2027) and the device flow restriction listed for November 30, 2026.
Are You at Risk?
Anything that runs less often than 30 days may be at risk. These include things like month-end exports or quarterly syncs, including seasonal workflows like year-end reporting. Monthly jobs that run on the last day of the month aren’t automatically safe either – the limit is 30 days and plenty of months have 31.
Anything that runs more often than that should be fine, because every time an integration uses its refresh token, the 30-day clock starts over. But if you’ve got a connection that was previously set up for a pilot and was never looked at again, you may want to check that again now.
One sneakier risk is that the clock restarts when the refresh token is used, and not when the app calls Salesforce. An app that keeps reusing a valid access token may never touch its refresh token, and the refresh token can expire anyway.
So ultimately, look into how the app handles its token, because how often a job runs is not a surefire way of identifying whether it’s safe.
How to Check Your Integrations
- List what’s connected. In Setup, open Connected Apps OAuth Usage for connected apps, and External Client Apps → OAuth Usage for external client apps. Look at everything that’s authorized, not just the apps you installed yourself.
- Check each app’s refresh token policy. If you still see “valid until revoked”, know that Salesforce says it stops applying once the limit is enforced. The UI and metadata may not update on their own, so don’t trust the screen alone. Here’s what happens for each policy:
| Policy | What happens under the 30-day limit |
|---|---|
| Refresh token is valid until revoked | No longer valid. The UI changes to “Expire refresh token if not used for specific time” at 30 days. Metadata isn’t updated automatically, so you change refreshTokenPolicy to specific_inactivity:30:DAYS yourself. |
| Immediately expire refresh token | No change. |
| Expire refresh token after ______ | Still uses the time period, but the idle limit also applies. So if it has a 1-year setting, idle tokens still expire at 30 days, then continuous use can reach 1 year. |
| Expire refresh token if not used for ______ | Already works as an idle limit. The period just can’t exceed 30 days. |
- For each app or vendor, ask whether it uses a refresh token, how often it actually exchanges it, and what happens if that fails.
- Since sandboxes have been enforcing the limit since October 21, test in a sandbox. Revoke the token and watch what the integration does. While it’s not the same as waiting 30 days, it can exercise the same re-authorization path.
The invalid_grant Error
When a refresh token has expired, the integration gets an invalid_grant error and stops until it’s re-authorized. In the logs, it can look like this:
{"error":"invalid_grant","error_description":"expired access/refresh token"}
On the user side, this can mean sync job failure, a “connection expired” message on the vendor tool, or an app asking someone to log in again.
While you can’t immediately assume the 30-day limit is the cause of such an error (the same error message can show up for other problems), it’s a good starting point to check whether the token has been idle for 30 days first.
How to Fix It
Depending on how much the integration is worth to you, you have four options:
- Re-authorize it: This is the quickest one, which is to sign the integration in again. It works for rare jobs where a person can step in, but it will happen again if nothing else changes.
- Retire it: If nobody owns it and misses it, this is the best fix and also the safest.
- Refresh the token before day 30: Salesforce notes that a client can run the refresh flow before the limit to get a new 30-day window. The catch is that a keep-alive preserves access nobody may still need, so it still comes back to identifying whether the integration is something the business really depends on.
- Move to a flow without a stored refresh token: For server-to-server integrations, vendor guides point to the JWT bearer or client credentials flows. This needs changes to the app, so check with your vendor or developer first, and confirm what Salesforce says the limit means for those flows.
Whichever route you pick, give the integration a named owner and an alert for authentication failures, so the next expiry doesn’t wait until month-end to be noticed. If your token already expired, re-authorize the connection, then decide on a longer-term fix from the options above.
Final Thoughts
A stolen or leaked token gives an attacker a window into your data, and a token nobody uses shouldn’t stay open forever. The 30-day limit is a sensible security control, but it only helps you if your integrations are ready for it.
Make sure to find time to spend an afternoon on the checks, such as doing an inventory of your connected apps or external client apps, noting how often they run (and taking a closer look at those that run less often than every 30 days), and re-authorizing anything that has already expired. This additional security feature should not come at the expense of broken integrations!









