Salesforce PKCE, Refresh Token Rotation (RTR) and DPoP are no longer optional. Salesforce is tightening OAuth security for Connected Apps and External Client Apps, and the biggest deadline is March 30, 2027. If you build or install apps that connect to Salesforce, this guide is for you.
This guide explains what each control means in simple words, who is hit, what admins and developers should do, what vendors must ship, and every date you need to know. Everything here comes from Salesforce’s own Help articles, linked in each section.
Quick Answer (Read This First)
- What changes: from March 30, 2027, Salesforce restricts new installations of any Connected App (CA) or External Client App (ECA) that doesn’t enable and lock PKCE, Refresh Token Rotation and one proof-of-possession control (Refresh Token IP Allowlist or DPoP).
- What keeps working: existing connections and API access continue.
- Will Salesforce turn these on for you? For most apps, no. You turn them on yourself. For a select group of apps, Salesforce turns on and locks PKCE and RTR on a date it emails you, but it never turns on the proof-of-possession control.
- Where do you check? Setup, then Insights. Red means non-compliant, green means compliant.
Official salesforce article you may check from : Security Change: PKCE, Refresh Token Rotation, and Proof-of-Possession – Restricting Installation of All Non-Compliant Apps
The Big Picture in One Picture
Each control blocks a different kind of OAuth token theft. The idea behind all three is the same. If an attacker copies an OAuth code or token, these controls make that copy useless.
The Three Changes, Explained Simply
1. Salesforce PKCE (Proof Key for Code Exchange)
What is Salesforce PKCE : Salesforce PKCE (Proof Key for Code Exchange) is an OAuth security extension. Your app sends a hashed secret (code_challenge) when it starts the login, and the original secret (code_verifier) when it trades the code for a token, so a stolen authorization code is useless.
The problem it solves: In the authorization code flow, Salesforce sends your app a one-time code. If someone intercepts that code, they could trade it for an access token.
How Salesforce PKCE fixes it: your app creates a secret random string (the code_verifier) and sends only a hashed version of it (the code_challenge) when it starts the login. Later, when your app trades the code for a token, it must send the original secret. An attacker who stole the code doesn’t have the secret, so the code is worthless.
Who it applies to: apps that use the authorization code grant, including the web server flow, the hybrid web server flow and the headless identity flows. If your app doesn’t use these flows, PKCE has no effect on your code.
What you update in code: generate a code_challenge and code_verifier. Send the challenge in the authorization request, and the verifier in the token request.
import base64, hashlib, secrets
code_verifier = base64.urlsafe_b64encode(secrets.token_bytes(32)).rstrip(b"=").decode()
code_challenge = base64.urlsafe_b64encode(
hashlib.sha256(code_verifier.encode()).digest()
).rstrip(b"=").decode()
Authorization request (note the S256 method):
https://MyDomain.my.salesforce.com/services/oauth2/authorize
?response_type=code
&client_id=<consumer_key>
&redirect_uri=<callback_url>
&code_challenge=<code_challenge>
&code_challenge_method=S256
Token request:
POST /services/oauth2/token
grant_type=authorization_code
&code=<code>
&client_id=<consumer_key>
&redirect_uri=<callback_url>
&code_verifier=<code_verifier>
Most OAuth libraries already do this for you. Check your library’s PKCE option before writing it by hand.
2. Refresh Token Rotation (RTR)
The problem it solves: Today a refresh token can be used again and again. If someone steals one, they get long-term access.
How RTR fixes it: every time your app uses a refresh token, Salesforce gives it a new refresh token and kills the old one. If anyone tries to reuse an old, already-used token, Salesforce revokes the current refresh token and all related access tokens. The app then has to log in again.
With rotation, a stolen refresh token only works until the real app uses it once.
Who it applies to: apps that use the refresh token flow. Nothing changes for an app that never asks for a refresh token.
What you update in code: read the refresh_token in the response of every refresh request, and overwrite the old one in your secure storage. That’s the whole change. The most common bug is forgetting this and keep sending the first token forever.
resp = requests.post(token_url, data={
"grant_type": "refresh_token",
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"refresh_token": load_refresh_token(),
}).json()
save_access_token(resp["access_token"])
if "refresh_token" in resp: # the NEW one
save_refresh_token(resp["refresh_token"]) # overwrite the old one
Two things to design for:
- Don’t refresh in parallel. If two workers refresh with the same token at the same time, the second one is replaying an old token. Salesforce’s troubleshooting advice says a failing refresh usually means the client is replaying an old token or racing a second refresh. Use one refresher, or a lock.
- Handle
invalid_grant. When a token is no longer valid you get this error. Log it and start a fresh OAuth flow. Don’t keep retrying the same token.
{"error":"invalid_grant","error_description":"expired access/refresh token"}
Also RTR only applies if your app’s OAuth requests include the refresh_token or offline_access scope.
3. Proof-of-Possession (PoP): Pick One
The problem it solves: a stolen token works from anywhere. PoP makes a token useful only for the real owner.
Salesforce requires at least one of these two controls. You don’t need both.
| Refresh Token IP Allowlist | DPoP | |
|---|---|---|
| In one line | Only IP addresses you approve can use the refresh token | The app must prove it holds a private key every time it uses a token |
| Setting name in Salesforce | Enforce Refresh Token IP Allowlist | Require Demonstrating Proof of Possession (DPoP) Extension |
| Best fit | Web apps with stable outbound IP addresses that use the refresh token flow | Server-to-server apps, apps without a stable IP, apps that don’t use the refresh token flow, browser and mobile apps |
| Code change | None in the app logic, but you must know your IP ranges | Yes. The client must send a DPoP proof with each token request and API call |
Option A: Refresh Token IP Allowlist
When it’s on, only IPs in your allowed ranges can complete the OAuth web server flow or the refresh token flow. Everything else is blocked completely. This is stricter than Trusted IP Ranges, which only ask for extra verification.
How to set it up:
- From Setup, open External Client Apps Manager.
- On your app, choose Edit Settings.
- Turn on Enforce Refresh Token IP Allowlist.
- In the Refresh Token IP Allowlist section, click Add, and enter a start and end IP address.
You can add up to 128 ranges, with no more than 10,000 IP addresses in total, and both IPv4 and IPv6 are supported.
Watch out: if your servers sit behind a cloud provider whose outbound IPs change, the allowlist will block your own refresh calls. In that case pick DPoP.
Option B: DPoP
DPoP is an open standard (RFC 9449). Your client has a public-private key pair. For every token request and every API call, it sends a small signed JWT (the “DPoP proof”) that shows it owns the private key. A thief with only the token can’t make that proof.
The token request follows this pattern:
- Your client creates a DPoP proof and sends the token request with a
DPoPheader. - Salesforce replies with an expected 400 error (
use_dpop_nonce) that includes aDPoP-Nonceheader. - Your client creates a new proof that includes the nonce, and retries.
- Salesforce returns a DPoP-bound access token. The
token_typein the response isDPoP.
For API calls, you then send two headers: Authorization: DPoP <access token> and a fresh DPoP proof that contains a hash of the access token. The nonce is valid for 24 hours, so your code must handle use_dpop_nonce again when it expires.
DPoP works with many flows, including client credentials, JWT bearer, refresh token and device flows. If you read our guide on getting a token with the client credentials flow, note that this flow is on the supported list.
Salesforce also gives Apex a helper, Auth.JWTUtil.generateDPoPProofForToken, to build proofs when the certificate is saved in Certificate and Key Management.
Mobile apps: if you use the Salesforce Mobile SDK, upgrade to Mobile SDK 14.0 or above, migrate users who are already logged in to DPoP, and make sure most of your users are on the new version before you turn DPoP on. Otherwise older app versions will fail.
What Changes in the Architecture: Before and After
OAuth itself isn’t being replaced. The endpoints and the flows stay the same. What changes is that every step now carries an extra proof, and tokens stop being reusable and portable.
Step-by-Step: What Is Different
| Step in the flow | Before | After | Which change |
|---|---|---|---|
| Authorize request | response_type, client_id, redirect_uri | Adds code_challenge and code_challenge_method=S256. With DPoP it also adds dpop_jkt (the key thumbprint) | PKCE, DPoP |
| Token request | code, client_id, client_secret, redirect_uri | Adds code_verifier. With DPoP it also sends a DPoP proof header, gets a use_dpop_nonce error once, then retries with the nonce | PKCE, DPoP |
| Token response | Access token and refresh token, token_type is Bearer | Same tokens, but with DPoP the token_type is DPoP and both tokens are tied to the client’s key | DPoP |
| API call | Authorization: Bearer <token> | With DPoP: Authorization: DPoP <token> plus a fresh DPoP proof that includes a hash of the token | DPoP |
| Refresh | The same refresh token can be used again and again | Each refresh token works once. The response contains a new one, and the old one dies | RTR |
| Reusing an old refresh token | Worked | Salesforce revokes the current refresh token and its access tokens. The client must log in again | RTR |
| Where a refresh can come from | Any network | With the IP allowlist, only approved IP ranges can complete the web server flow or the refresh token flow. Everything else is blocked | PoP: IP allowlist |
| Idle refresh token | Whatever refresh token policy the app set | Capped at 30 days of inactivity (separate change, already rolling out) | Idle TTL |
What This Means for Your Design
Four things change in how an integration is built:
- Your token store is no longer write-once. Before, you saved the refresh token at login and only read it afterwards. Now every refresh is a read, call, overwrite sequence. If the write fails, the next refresh fails.
- Refreshes must not run in parallel for the same token. Two workers refreshing with the same token means the second one replays a dead token. Use one refresher or a lock per connection. Salesforce also warns that if several client apps share one Consumer Key, they must all be updated for token storage at the same time, or they’ll go out of sync.
- The client now keeps short-lived state. With PKCE, the
code_verifiermust be remembered between the authorize redirect and the token request. With DPoP, the client must also keep a key pair safe and track the nonce, which is valid for 24 hours. - Network identity can become part of security. If you choose the IP allowlist, your outbound IP addresses have to be stable and known. A cloud provider that rotates egress IPs will block your own refreshes.
Enforcement Dates
There are two separate changes, and people mix them up. Here’s the difference.
| Change 1: All non-compliant apps | Change 2: Select apps | |
|---|---|---|
| What Salesforce does | Blocks new installs of the app in other orgs | Turns on and locks PKCE and RTR for the app, and blocks new installs until you also enable and lock a PoP control |
| Date | March 30, 2027, same date for everyone | A different date for each app. Salesforce emails app owners and org admins |
| Extension? | No | Not mentioned. Check your email for the terms |
| Where to see the date | It’s fixed | Email, and from late February on the Insights page. Salesforce Support doesn’t know your date, so don’t ask them |
The Wider Roadmap (Related Changes)
These other OAuth changes are on Salesforce’s roadmap page. Some are already live, so check them too.
| Change | Date |
|---|---|
| Refresh token idle TTL limited to 30 days | Oct 21, 2026 (sandbox), Nov 4, 2026 (production) |
| OAuth 2.0 Device Flow restricted to Local ECAs | Nov 30, 2026 |
| OAuth 2.0 Username-Password Flow retirement | Feb 20, 2027 |
| OAuth 2.0 User-Agent and Hybrid Flows retirement | Feb 20, 2027 |
| Block install of non-compliant apps (this article) | Mar 30, 2027 |
| Connected Apps end of support | Summer ’27 (all environments) |
Who Is Impacted and How
| Who you are | What it means for you |
|---|---|
| You build an app others install (ISV, partner, consultancy with a packaged app) | After March 30, 2027 your app can’t be installed in a new org unless PKCE, RTR and one PoP control are enabled and locked. You must change your client code and your app settings. |
| You built an app only for your own org (Distribution State: Local) | Salesforce’s article describes the block as stopping installs in other orgs. Still check Insights, because Salesforce can select your app for the separate enforcement (Change 2), and the 30-day idle limit already applies. |
| You install apps from AppExchange or a vendor | You can’t change their code. Insights shows their status (Packaged or Installed). If a control is red, contact the vendor. After enforcement, a non-compliant app can’t be installed in another org, but existing connections keep working. |
| You run a mobile app on Mobile SDK | Upgrade to Mobile SDK 14.0 or above, and plan the DPoP migration for logged-in users. |
| You run background integrations (middleware, iPaaS, scheduled jobs) | RTR means your code must store the new refresh token on every refresh. The 30-day idle limit means anything that runs less than once every 30 days will need re-authorization. |
What Salesforce Admins and Developers Must Do
Do all of this in a sandbox first, then production.
Step 1: Find Your Non-Compliant Apps with the Insights Page
- From Setup, type Insights in Quick Find and select Insights.
- Filter by App Type, or search by name.
- In the Security Controls column, look for apps with failing (red) controls. Each app shows badges such as OAuth Control: 3/3 (how many of the three OAuth controls are on) and Proof of Possession Control: 0/1 (you need at least one).
- From the app’s actions menu, choose Configure Security Posture.
- If the app is Local, click Manage App and turn on the missing controls. If it’s Packaged, contact the developer at the address shown. You can also click Disable to switch the app off until the developer updates it.
The Insights page checks four things: Refresh Token Rotation, PKCE and Refresh Token TTL (all required), plus at least one PoP control. It’s available in Lightning Experience for Professional, Enterprise, Unlimited and Developer editions. To edit a local ECA you need the Create, edit, and delete External Client Apps permission.
Step 2: Match Each App to Its Flows
Make a simple table for each app you own:
| App | Uses auth code flow? (needs PKCE) | Uses refresh tokens? (needs RTR) | PoP choice |
|---|---|---|---|
| Example: Order sync middleware | Yes | Yes | IP allowlist (fixed server IPs) |
| Example: Mobile field app | Yes | Yes | DPoP (Mobile SDK 14.0+) |
| Example: Nightly client-credentials job | No | No | DPoP |
If an app also runs less than once every 30 days with a stored refresh token, add a note. It needs a re-authorization plan (see the idle TTL section below).
Step 3: Change the Client Code First, Test in Sandbox
Order matters. Change the code first and confirm it in a sandbox, then turn on the setting. If you turn the setting on first, the integration breaks.
- PKCE: add
code_challengeandcode_verifieras shown earlier. Restart the client app after you change the settings, then test the connection. - RTR: make sure the refresh response handler saves the new refresh token. Add
invalid_granthandling. - PoP: collect your stable outbound IP ranges, or add DPoP proof generation.
PKCE needs a coordinated change on both the server and the client, so plan a little downtime for the impacted integrations.
Step 4: Turn On the Settings in the External Client App
Find your app in External Client Apps Manager, then the Settings tab, then OAuth Settings. In the Security area, enable:
- Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows
- Enable Refresh Token Rotation
- Enforce Refresh Token IP Allowlist or Require Demonstrating Proof of Possession (DPoP) Extension
For a brand-new app, you can enable RTR while creating it: Setup, External Client Apps Manager, New External Client App, check Enable OAuth, then check Enable Refresh Token Rotation in the security section.
Step 5: Lock the Controls
After all changes work, you must lock the controls. Once you lock each control and click Confirm, you can’t turn it off again. Test everything before this click. The screen says “Review and lock security controls for Partner Applications”, and Salesforce confirms the locking requirement also applies to non-partner apps.
Step 6: Re-Check Insights
Go back to the Insights page. All controls on your app should be green. Do this for every app you own.
Optional: Require PKCE for the Whole Org
Once every client app is updated, the org owner can make PKCE mandatory org-wide: from Setup, open OAuth and OpenID Connect Settings and turn on Require Proof Key for Code Exchange (PKCE). This prevents new client apps from being deployed without PKCE. Only do it after each app is ready, and test in a sandbox first. Note that an ISV or managed package publisher can’t do this step. Only the org owner can.
What Third Parties (Microsoft and Every Other Vendor) Must Change
Any company whose product connects to Salesforce through a Connected App or External Client App is a third party here. That includes big platform vendors, AppExchange partners, integration tools and small consultancies. Salesforce’s articles don’t name any specific vendor, so this is the checklist that applies to all of them.
What a Vendor Must Do, Change by Change
| Change | In the product code | In infrastructure | In the Salesforce app settings |
|---|---|---|---|
| PKCE | Generate code_verifier and code_challenge for every login. Send the challenge in the authorize request, and the verifier in the token request. Applies to public and confidential clients | Keep the verifier safe until the token request completes | Turn on and lock Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows |
| Refresh Token Rotation | Read the new refresh_token from every refresh response and save it. Handle invalid_grant by starting a fresh login. Include the refresh_token or offline_access scope | A token store that can safely update one record per connection. One refresher at a time. Update every client that shares the same Consumer Key (web, mobile, background workers) together | Turn on and lock Enable Refresh Token Rotation |
| IP Allowlist (PoP option A) | No change to app logic | Stable, known outbound IP addresses | Turn on and lock Enforce Refresh Token IP Allowlist and add the IP ranges (up to 128 ranges, 10,000 IPs in total) |
| DPoP (PoP option B) | Sign a DPoP proof for every token request and every API call. Handle the use_dpop_nonce error and refresh the nonce every 24 hours. Use Authorization: DPoP | A key pair, stored safely | Turn on and lock Require Demonstrating Proof of Possession (DPoP) Extension |
| 30-day idle limit | Re-authorize automatically when a refresh token expires. Monitor failures | Alerts for connections that haven’t refreshed recently | Nothing to turn on. Salesforce enforces it |
| Mobile SDK apps | Upgrade to Mobile SDK 14.0 or above. Migrate users already logged in to DPoP | Make sure most users have the new version before DPoP is turned on | Same settings as above |
The Order a Vendor Should Follow
The order matters. Turning on a setting before the code is ready breaks connections.
- List every client. Web app, mobile app, background workers, test tools. Find which ones share a Consumer Key.
- Change the client code for PKCE, refresh token storage and the chosen PoP control.
- Test in a sandbox or Developer Edition org with the settings turned on. For mobile apps, Salesforce has specific test guides after the Mobile SDK 14.0 upgrade (one for RTR and one for DPoP).
- Turn on the settings on the app.
- Lock the controls. You can’t turn them off after you confirm.
- Check Insights in the org that owns the app. It should show green.
- Ship the new version and the installation steps.
- Tell customers. Say which controls are on, which PoP option you chose, whether customers must reauthorize, and what to do if an install fails.
- Watch for errors after rollout, especially
invalid_grant,use_dpop_nonceand PKCE validation failures.
Also keep the contact email on the app monitored. For apps developed elsewhere, the Security Posture window in a customer’s Insights page shows the developer’s contact address, so that’s where your customers will write to you.
A Worked Example (Illustrative, Not a Real Company)
Take a cloud connector that links thousands of customers’ Salesforce orgs to another system.
Before:
- Starts login with a plain authorize request
- Saves one refresh token per customer and reuses it forever
- Calls Salesforce from many cloud servers whose IP addresses change
- No re-authorization plan
After:
- PKCE: the login service generates a verifier and challenge for each login and keeps the verifier in the user’s session until the token request.
- RTR: the refresh job takes a lock on the customer’s connection, refreshes, saves the new refresh token, then releases the lock. If it gets
invalid_grant, it marks the connection as “needs reauthorization” and tells the customer. - PoP: the IP allowlist doesn’t fit because outbound IPs change, so the connector chooses DPoP. It creates a key pair, signs proofs, and stores the latest nonce.
- Idle limit: a daily check flags connections that haven’t refreshed in 25 days so customers can be warned.
- Salesforce settings: the team turns on and locks PKCE, RTR and DPoP, confirms Insights is green, and publishes the new version with updated install steps.
Real-World Examples
Example 1: The nightly sync that stops after a week. A middleware tool stores one refresh token and sends it every night. After RTR is turned on, the first refresh works and returns a new token, but the tool keeps saving the old one. The second night’s refresh uses a dead token and fails with invalid_grant.
Fix: update the refresh handler to save the new refresh_token each time.
Example 2: The new sandbox that won’t install the package. After March 30, 2027, your admin tries to install a vendor’s app into a fresh sandbox and the install is blocked.
Fix: open Insights in an org that already has the app, copy the red controls, and send them to the vendor. Existing connections in your other orgs keep working in the meantime.
Example 3: The mobile app and DPoP. A field team uses a custom mobile app built on the Mobile SDK. The developer turns on DPoP before most users update. Older app versions stop working.
Fix: upgrade to Mobile SDK 14.0 or above, migrate logged-in sessions, and enable DPoP after most users are on the new version.
Example 4: The quarterly job. A reporting job runs once every 90 days using a stored refresh token. With the 30-day idle limit, the token is dead long before the next run.
Fix: add a re-authorization process, or look at a flow that doesn’t depend on a stored refresh token.
The 30-Day Idle Refresh Token Limit (Already Rolling Out)
This related change is already in progress, so we cover it here.
- What it is: a refresh token that hasn’t been used for 30 days expires, along with its access token. For flows that don’t use refresh tokens, access tokens expire when the last login was more than 30 days ago.
- Dates: rolling basis starting October 21, 2026 for sandboxes, and November 4, 2026 for production, scratch and Developer Edition orgs.
- Already enforced for: partner apps, and apps created in July 2026 and later.
- Support can’t change it: after enforcement you can’t contact Salesforce Support to change this setting.
What you’ll see when a refresh token expires:
{"error":"invalid_grant","error_description":"expired access/refresh token"}
| Integration type | What happens | What you do |
|---|---|---|
| Background integration with refresh token | Token expires, invalid_grant returned | Re-run the OAuth flow. Build automatic reauthorization and monitoring |
| Interactive app with refresh token | User is logged out | User logs in again |
| Flow without refresh tokens | Access token expires if last login was over 30 days ago | Repeat the initial flow to get a new token. Salesforce lists no action beyond that |
Salesforce also gives two good audit tips:
- Audit refresh token activity. In Setup, open Login History, create a view with the filter Login Subtype equals OAuth Refresh Token (and OAuth Refresh Token for Hybrid Apps), and add the Login Subtype and Login Time fields. This shows when tokens were last used.
- Test revocation. Run your OAuth flow, then in Setup open Users, pick the integration user, find the app in OAuth Apps, click Revoke, and see how your app behaves.
Salesforce also says not to create artificial refresh activity just to keep a token alive.
After March 30, 2027: How to Fix an Installation Error
- Open Insights and view the app’s OAuth settings. Note any controls that are red.
- Apps you own: update the app settings and client-side code.
- Apps you don’t own: send the Insights status to the developer and ask for an update. When they finish, follow their installation instructions.
- Contact Salesforce Support only to troubleshoot an error. Support can’t waive the requirement or opt you out.
If your refresh calls fail after the change, reproduce the failed request and capture the exact OAuth error. An invalid or expired refresh token usually means the client is replaying an old token or racing a second refresh. If PKCE validation fails, check that the authorization request uses code_challenge_method=S256 and the token request sends the original code_verifier.
Common Questions
Will Salesforce turn these controls on for me? For most apps, no. Under the March 30 change Salesforce only blocks new installs of non-compliant apps. For selected apps, Salesforce turns on and locks PKCE and RTR on the app’s date, but never a PoP control.
Can I get an extension for March 30, 2027? No. Salesforce doesn’t support extensions for this change.
Do I need both DPoP and the IP allowlist? No. One proof-of-possession control is enough.
Do I have to lock the controls? Yes. Test first, because you can’t disable a control after you lock it.
Do existing connections stop working on March 30? No. Existing connections keep working and API access continues. The restriction is on new installations.
Can I still create new Connected Apps? No. New integrations should be External Client Apps. Starting in Spring ’26, you can’t create new Connected Apps.
I use an AppExchange or managed-package app. What should I do? Check its status on the Insights page and ask the vendor to enable PKCE, RTR and one PoP control, and to ship the client changes.
Where do I find my app’s enforcement date (select apps)? In the email Salesforce sends to app owners and org admins. From late February you can also see it on the Insights page.
Wrapping Up
These changes sound heavy, but each one has a small, clear job. PKCE protects the login code, Refresh Token Rotation protects the refresh token, and proof-of-possession protects every token from being used by someone else. Start with the Insights page this week, fix your own apps first, and push vendors for theirs. March 30, 2027 is closer than it looks.
Need Help Reviewing Your Salesforce Integrations?
👉 Book a session: topmate.io/triggerhours
More Salesforce integration and security guides at triggerhours.co
Discover more from Trigger Hours
Subscribe to get the latest posts sent to your email.
Helpful information about new security changes.
Thanks Komal