Skip to content

The Re-Entry Pass, Over Time

Module 3 of 5 in the chapter External Client Apps, Tokens and Their Lifecycle, chapter 13 of Securing Salesforce: Identity and Access. Each module stands on its own.

The question this module answers: What happens to a refresh token after it’s handed out, and how does an admin take it back?

How often do you log in to your streaming app?

Section titled “How often do you log in to your streaming app?”

Here’s a question I ask the room. If you watch a streaming service on your phone, how often do you have to put in your password? Every day? Every hour? Not very often.

What’s happening behind the scenes is that the app signed you in once and got a refresh token. When its access token runs out, it uses the refresh token to get a new one, without bugging you. In the web server flow (chapter 9), the refresh token came for the ride: not only did the Burger House get an access token, it got a refresh token too. At the festival, it’s the re-entry pass (chapter 8).

That’s lovely for Priya. It’s also a token that keeps working long after she’s stopped thinking about it. So what happens to it over time, and who can take it back?

Integration Architect’s chapter 13, module 7, teaches this as a design decision for integrations. This module is the admin’s side: where each control is switched on, and what it does.

The re-entry pass, over time A refresh token's life, one row per moment. She approves the app, on day one, once: it gives an access token and a refresh token, which came for the ride, so she isn't asked again and the app keeps it securely. Each refresh, with rotation on, gives a new refresh token and the old one dies, so a copied old one is caught, because reuse revokes them all. After 30 days unused, the idle clock runs out: it expires and its access token is revoked, so a forgotten one can't wake up, and she signs in again. Taken back, by her, the admin or the API: revoked, or the app blocked on the OAuth Usage page, so the app must ask again from the beginning. With DPoP, switched on with Require DPoP on the app, the token is bound to the app's key and each use proves it holds the key, so a stolen one is useless without the private key. Green marks what limits a stolen token. Footnote: on for every new app since July 2026, rotation and the 30-day idle limit; older apps, switch them on. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.58.0", "built": "2026-11-05", "id": "DGM-IAM-AT-03", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} THE MOMENT WHAT HAPPENS WHAT IT PROTECTS She approves the app day one, once Access + refresh token the refresh token came for the ride She isn't asked again the app keeps it securely Each refresh with rotation on A new refresh token the old one dies A copied old one is caught reuse revokes them all 30 days unused the idle clock runs out It expires and its access token is revoked A forgotten one can't wake up she signs in again Taken back by her, the admin, or the API Revoked or the app blocked on the OAuth Usage page The app must ask again from the beginning With DPoP Require DPoP on the app Bound to the app's key each use proves it holds the key A stolen one is useless without the private key gives so gives so and so and so makes it so On for every new app since July 2026: rotation and the 30-day idle limit. Older apps: switch them on. HOW TO READ IT what limits a stolen token © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Turn on Enable Refresh Token Rotation in the app’s OAuth settings, and every time the refresh token is used, the app gets a new one and the old one dies. Salesforce calls it “a security best practice” (S6).

And here’s the clever part. If someone tries to use a refresh token that’s already been rotated out, Salesforce doesn’t just refuse it: it “invalidates the current refresh token and any associated access tokens” (S6). A copy used by a thief gets caught, and takes the good one down with it. The real app has to sign in again, and someone notices.

A refresh token nobody uses for 30 days expires. Salesforce “requires a 30-day limit to the idle refresh token TTL” (time to live), and it’s a sliding window: “each time the token is used within the 30 day-period, its idle TTL resets” (S6). When it expires, “Salesforce revokes the associated access token”, and the person signs in again (S6). For flows with no refresh token, the same control “caps the access token lifetime at 30 days from the last login date” (S6).

It’s being enforced in production on a rolling basis from November 4, 2026, for every connected app and external client app, installed ones included (the shared security record). So a token forgotten in an old integration can’t wake up a year later.

From July 2026, every new app gets rotation and the 30-day idle limit switched on, with PKCE (S11). Apps made before then may not have rotation on. That’s what module 1’s Insights page is for: find the apps missing controls, and switch them on.

Only from where it should be: the IP allowlist

Section titled “Only from where it should be: the IP allowlist”

For an app that runs from known addresses, Enforce Refresh Token IP Allowlist: only those addresses can use the web server flow or the refresh token flow (S6). A refresh token copied and used from elsewhere gets nothing.

One more limit, from Integration’s module 7: by default, five authorizations per app per user. Approve a sixth, and the one unused the longest is revoked. For Priya with a laptop, a phone and a tablet, that’s plenty.

Every token you hand out, you should know how to take back. Three ways:

  • She can. Priya can revoke an app’s access to her own account. In the refresh token video I put it simply: the refresh token can be revoked by the user.
  • The admin can. On the OAuth Usage page for external client apps, review active integrations and “block any suspicious or unapproved clients” (S9). Blocking an app ends its sessions (module 2).
  • Code can. The revoke endpoint, /services/oauth2/revoke (chapter 8): revoke a refresh token and its access tokens go with it. Put it in your runbook for when a partner says they’ve been breached.

The last control goes furthest. DPoP, Demonstrating Proof-of-Possession, “cryptographically binds OAuth access and refresh tokens to your client. To use a token, clients must prove that they own the private key. Even if a threat actor steals an OAuth token, they can’t use it to access your data” (S10). It’s available on a rolling basis from October 5, 2026, for both kinds of app (S10).

It’s two halves again, like module 1: the admin turns on Require DPoP in the app’s OAuth settings, and the developer has to make the client produce DPoP proofs (S10). Switch it on before the client is ready, and the app stops working.

Test knowledge. The exam guide aligns to Summer ‘23, before rotation, the idle limit and DPoP. In my experience, know what a refresh token is for, which flows give one, and how it’s revoked.

Beyond the exam: what AI changes. Agents and MCP servers hold tokens too, often refresh tokens, often for a long time. Everything in this module applies to them. Chapter 17 takes it further.

In 2023 I made a video of the refresh token flow: the token that came for the ride, stored securely, and swapped for a new access token. The note under the video says what’s still right and what’s changed since.

STA 3.17 · Salesforce OAuth Refresh Token Flow · 5:57 · published 2023-10-13 · plays from YouTube when you click it · Watch on YouTube · More videos: Salesforce Identity & Access Videos

Module 4: where it went wrong, 2024 to 2026, and which of these controls would have closed the door.

  • Rotation on for every app with refresh tokens, old ones included.
  • Who checks the Insights page for apps missing controls.
  • IP allowlists for apps that run from known addresses.
  • The revoke runbook: which app, which user, who may pull the plug.
  • DPoP for the apps whose tokens would hurt most if stolen, with the developer ready first.