Tevpro insights
Salesforce DPoP requirements for external apps and how to implement them
Salesforce’s reported 2027 change to app installation security does not mandate DPoP for every app. Understand the choices, timeline, and a practical JavaScript proof example.
Key takeaways
- The reported March 30, 2027 gate concerns new installations of noncompliant apps into other orgs, not existing connections.
- The quoted policy requires PKCE, refresh token rotation, and one proof of possession control; DPoP is an option, not a universal mandate.
- For authorization code flows, Salesforce requires dpop_jkt, a token nonce challenge, and new signed proofs for token and resource requests.
- Confirm Salesforce’s primary notice and test the exact app flow in a sandbox before publishing or enabling controls.
Does Salesforce require DPoP for external client apps?
Not necessarily. According to a Salesforce security notice reproduced in a public issue, connected apps and external client apps must use PKCE and refresh token rotation, plus one proof-of-possession control. The notice lists two options for that control: a refresh token IP allowlist or DPoP. On that wording, DPoP is one option, not a requirement for every app. [1]
DPoP stands for Demonstrating Proof of Possession. It is an OAuth 2.0 mechanism that ties access and refresh tokens to a cryptographic key held by the client. The client signs a fresh proof with its private key for token and API requests, so Salesforce can verify that the caller possesses that key. A stolen token by itself is not enough to make those requests. [2][3]
The same quoted notice gives March 30, 2027 as the enforcement date across all environments for blocking new attempts to install noncompliant apps in other orgs. It says existing connections and API access continue. We found the quotation in a public issue created November 18, 2026, but could not independently establish the date Salesforce first sent or published the notice. Confirm the date, exact scope, and any separate notice of stricter enforcement in your Salesforce Trust/Setup communications before treating this as a final policy announcement. [1]
What changes and who needs to act?
Inventory connected apps and external client apps that other orgs must install. Check the Salesforce Setup Insights view cited in the notice for missing controls, then confirm which OAuth grants each app uses. A red indicator is a lead for investigation, not proof that DPoP specifically is required. If your team controls the app, plan and test the needed PKCE, refresh token rotation, and one appropriate proof of possession option in a sandbox before locking controls. [1]
Choose an IP allowlist for refresh tokens only if the relevant clients use a stable, managed egress path and the control fits the app. Choose DPoP when the client can protect and reuse its private key across authorization, token exchange, refresh, and API calls. Salesforce’s DPoP guide describes the integration path; it does not say every external client app must enable DPoP. Confirm which OAuth flows the separate security notice covers before changing a production app. [1][3]
What DPoP changes in code
Salesforce’s guide starts with an OAuth external client app or connected app that has “Require DPoP” enabled and a client certificate with a public and private key pair. For an authorization code flow, include dpop_jkt, the RFC 7638 thumbprint of the public key, on the authorization request. The authorization code is then tied to that key. The sample below uses a protected P-256 private key to compute the thumbprint and sign ES256 proof JWTs; provisioning the key and certificate is a separate step. [2][3]
The token endpoint expects a fresh signed DPoP proof on the first request and responds with an expected HTTP 400 use_dpop_nonce challenge and a DPoP-Nonce header. Retry with a new proof containing that nonce. Salesforce says the token nonce lasts 24 hours; on expiry, handle the next challenge instead of reusing it. The token response should report token_type DPoP. Every resource call needs Authorization: DPoP plus another signed proof containing ath, the SHA-256 hash of the access token, and a valid nonce. Refresh calls use the same bound key and another proof. [2][3]
import {
createHash, createPrivateKey, createPublicKey, randomUUID, sign,
} from 'node:crypto';
// Load the same protected P-256 key for authorization, token, refresh and API calls.
const privateKey = createPrivateKey(process.env.DPOP_PRIVATE_KEY_PEM);
const exported = createPublicKey(privateKey).export({ format: 'jwk' });
if (exported.kty !== 'EC' || exported.crv !== 'P-256') throw Error('Use a P-256 key');
const jwk = { crv: exported.crv, kty: 'EC', x: exported.x, y: exported.y };
const hash = (value) => createHash('sha256').update(value).digest('base64url');
export const dpopJkt = hash(JSON.stringify(jwk)); // RFC 7638 key order: crv, kty, x, y
const b64 = (value) => Buffer.from(JSON.stringify(value)).toString('base64url');
export function proof(method, url, token, nonce) {
const target = new URL(url);
const payload = {
jti: randomUUID(), htm: method, htu: target.origin + target.pathname,
iat: Math.floor(Date.now() / 1000),
};
if (token) payload.ath = hash(token);
if (nonce) payload.nonce = nonce;
const input = `${b64({ typ: 'dpop+jwt', alg: 'ES256', jwk })}.${b64(payload)}`;
const signature = sign('sha256', Buffer.from(input), {
key: privateKey, dsaEncoding: 'ieee-p1363',
}).toString('base64url');
return `${input}.${signature}`;
}
export function authorizeUrl(loginOrigin, clientId, redirectUri, state, codeChallenge) {
const url = new URL('/services/oauth2/authorize', loginOrigin);
url.search = new URLSearchParams({
response_type: 'code', client_id: clientId, redirect_uri: redirectUri,
state, code_challenge: codeChallenge, code_challenge_method: 'S256',
dpop_jkt: dpopJkt,
}).toString();
return url.toString();
}
// Supply the authorization code, PKCE verifier and client authentication
// through form. Do not print the form or return an OAuth error body to logs.
export async function tokenRequest(loginOrigin, form) {
const endpoint = new URL('/services/oauth2/token', loginOrigin).toString();
let nonce;
for (let attempt = 0; attempt < 2; attempt++) {
const response = await fetch(endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded',
DPoP: proof('POST', endpoint, undefined, nonce) },
body: new URLSearchParams(form),
});
const result = await response.json();
const nextNonce = response.headers.get('DPoP-Nonce');
if (!response.ok && result.error === 'use_dpop_nonce' && nextNonce && attempt === 0) {
nonce = nextNonce;
continue; // A new proof, including nonce, is signed on this retry.
}
if (!response.ok) throw Error(`OAuth token request failed (${response.status})`);
if (result.token_type !== 'DPoP') throw Error('Expected a DPoP-bound token');
return { tokens: result, nonce: nextNonce || nonce };
}
throw Error('Token nonce challenge failed');
}
// Use the instance_url from the token response, not the login URL.
export async function getUserInfo(instanceUrl, accessToken, nonce) {
const endpoint = new URL('/services/oauth2/userinfo', instanceUrl).toString();
for (let attempt = 0; attempt < 2; attempt++) {
const response = await fetch(endpoint, {
method: 'POST',
headers: { Authorization: `DPoP ${accessToken}`,
DPoP: proof('POST', endpoint, accessToken, nonce) },
});
if (response.ok) return { data: await response.json(), nonce };
const nextNonce = response.headers.get('DPoP-Nonce');
if (attempt === 0 && nextNonce && [400, 401].includes(response.status)) {
nonce = nextNonce; // Resource servers can use a different nonce.
continue;
}
throw Error(`Salesforce resource request failed (${response.status})`);
}
throw Error('Resource nonce challenge failed');
}
// A refresh uses tokenRequest with grant_type=refresh_token, client details,
// and the bound refresh token. Keep using this same private key.
Run this as a server side Node.js module. Load DPOP_PRIVATE_KEY_PEM from a protected secret store and keep the same key for authorization, token exchange, refresh, and resource calls. First generate and retain your PKCE verifier and challenge, call authorizeUrl(...), and send the user to that URL. On the callback, validate state and pass the authorization code, same redirect URI, and PKCE verifier in the grant form to tokenRequest(...). Then call getUserInfo(tokens.instance_url, tokens.access_token, nonce). For refresh, call tokenRequest(...) with grant_type=refresh_token, client details, and the bound refresh token. Keep the nonce returned by the resource call for subsequent requests. [3]
The example signs a new JWT for each request and retries one nonce challenge at the token endpoint and one at the resource endpoint. It uses the POST /services/oauth2/userinfo request shown in Salesforce’s guide. It does not implement browser redirect handling, certificate creation, secret management, refresh token storage, or general retries for writes. Do not log private keys, OAuth forms, access tokens, or full error responses. We checked the signature, thumbprint, PKCE URL, and simulated nonce exchanges locally; a Salesforce sandbox test is still required. [2][3]
A real migration test
In a sandbox, first confirm that the existing OAuth grant works. Enable the DPoP setting, then test a new authorization with dpop_jkt, the expected token nonce challenge, token_type DPoP, an API request with ath and a valid nonce, and a refresh using the same key. Verify that a missing or reused proof fails. Check libraries, CLI jobs, SOAP calls, and streaming integrations separately: Salesforce’s sfdx-core implementation notes describe distinct SOAP handling and a Streaming API limitation for sessions bound to DPoP in its tested environment. Those are implementation observations, not a universal compatibility guarantee. [3][4]
What if the current client cannot send DPoP?
Do not enable the control in production first and hope the library catches up. A public report describes a JWT bearer login failing with “app requires proof of possession” after DPoP was enabled. Evaluate the IP allowlist option against your network and threat model, upgrade or extend the OAuth client, and test the exact grant and API surface in a sandbox. [1]
Sources
Why work with us
Why Tevpro?
Whether you’re a startup with a bold product idea or an established company seeking a stronger delivery partner, Tevpro delivers results. Our expert consultants specialize in building secure, scalable applications that simplify operations and drive real ROI.


