When a third-party integration that holds OAuth access to your Salesforce org is suspected of compromise, the first hour is about cutting its tokens and sessions, not about understanding everything it did. This guide walks a Salesforce administrator through the emergency path: confirm which connected app is affected, block it, revoke its refresh and access tokens, deal with the integration user behind it, and then prove that nothing still works. It is deliberately narrow. Routine review of connected apps, permission sets and integration users is covered in How to review Salesforce connected apps and integration users, and the wider incident lifecycle is covered in the Salesforce Org Compromise Playbook.
A third-party integration is a non-human identity. It usually consists of three linked parts: a connected app definition (the OAuth client), one or more OAuth grants issued to a Salesforce user, and the user record whose permissions the tokens carry. A compromise of the vendor, of the vendor's token store, or of a person who approved the app all end in the same place: someone outside your organisation can call Salesforce APIs as that user until the grants are revoked. Cutting only one of the three parts leaves a way back in.
This is an independent guide from NHI Mgmt Group, based on Salesforce's public documentation as of November 2026. It is not sponsored or reviewed by Salesforce. Product features change, so confirm settings against Salesforce's current documentation.
Key takeaways
- Blocking a connected app from the Connected Apps OAuth Usage page ends all current user sessions for that app and prevents future sessions until you click Unblock. Use it first when you need to stop the app quickly.
- Revoking a refresh token through the revocation endpoint revokes that refresh token and all associated access tokens. Revoking only an access token leaves the refresh token able to mint new ones.
- Salesforce documentation reviewed for this guide does not say that Block revokes OAuth tokens, so treat Block and Revoke as two separate steps and do both.
- The integration user is part of the blast radius. Freeze or deactivate it, reset its credentials and review what its permission sets allowed.
- Uninstalling a connected app removes only your local copy and the policies you set. It does not remove the connected app, so it is not a containment step.
- Prove the cut worked: confirm user counts drop to zero, test that a held token fails, and watch login and API activity for the integration user.
When to use this emergency path
Use this guide when any of the following is true, even before the vendor confirms anything:
- The integration vendor tells you, or publicly states, that OAuth tokens or customer credentials held in its platform may have been exposed.
- Your monitoring shows API activity from the integration user that does not match the integration's normal pattern, such as bulk queries against objects it never reads, or activity from unexpected networks.
- A user reports that they approved an app after an unexpected phone call, chat or email, and the app is not one your organisation recognises.
- A new connected app with broad scopes appears in the OAuth usage list and nobody owns it.
The decision rule NHI Mgmt Group recommends is simple: if the integration is not business-critical in the next few hours, block and revoke immediately and investigate afterwards. If it is business-critical, agree a short window with the business owner, but revoke the tokens regardless. A compromised token store means the vendor's own service is likely to be disrupted anyway while it rotates credentials.
Before you start: permissions and evidence
To reach the Connected Apps OAuth Usage page you need the View Setup and Configuration and Manage Users permissions, according to Salesforce's packaging guide. Managing, creating, editing and deleting OAuth apps requires the Manage Connected Apps permission. Confirm that the administrator on call has these before the incident, not during it.
Capture evidence before you change anything, because blocking and revoking will change what the usage pages show:
- Take screenshots or exports of the Connected Apps OAuth Usage page, including the User Count for the suspect app.
- Open the User Count drill-down (the Connected Apps User's Usage page), which shows when each user first used the app, their most recent use and their total number of uses. Record it.
- For the integration user, record the OAuth Connected Apps section of the user detail page. Salesforce notes that Use Count and Last Used are updated even when an app fails to log in, which is useful later when you test that revocation worked.
- Note the connected app's current policies (Permitted Users, IP relaxation, refresh token policy) before you edit them, so you can show what changed.
- Pull login history and, if you license it, the event log files described in the Salesforce Event Monitoring Detection Guide. Log retention is limited, so export now.
Step 1: identify the connected app and every grant
In Setup, enter OAuth in Quick Find and select Connected Apps OAuth Usage. The page lists each connected app with the columns Connected App, Description, Manage App Policies, User Count and Actions. Find the app that matches the vendor. Be careful with names: vendors often publish more than one connected app, and an app created in another org may appear here before it has been installed in yours.
Click the User Count number. If more people than the expected integration user have authorised the app, every one of those users holds a grant that must be revoked, and each one is a possible path into data they can see.
Remember how grants accumulate. Salesforce documentation states that an app can appear more than once on a user's list because each new access token adds an entry, and an OAuth 2.0 app requesting tokens with different scopes appears multiple times. Each app allows five unique approvals per user; after a fifth approval the oldest approval is revoked. For OAuth 2.0, each refresh token counts as one approval. In practice this means a single integration user can hold several live refresh tokens for the same app, so revoke every entry, not just the first one you see.
Step 2: block the connected app
On the Connected Apps OAuth Usage page, use the Block action for the suspect app. Salesforce's documentation states that blocking an app ends all current user sessions and prevents future sessions until you click Unblock. This is the fastest single action available to an administrator and does not depend on knowing every token value.
Two cautions apply. First, the documentation reviewed does not say whether Block revokes the OAuth tokens themselves. Do not rely on Block alone: continue to Step 3 and revoke the tokens explicitly, so that unblocking later cannot silently restore the attacker's access. Second, note the Unblock behaviour. If Unblock is disabled, the documentation says the app is not on your approved list; to enable it you install the app, edit its policies and set Permitted Users to "Admin approved users are pre-authorized". Plan the restore path now, so the business owner knows what reinstatement involves.
Do not use Uninstall as a containment step. Salesforce states that Uninstall removes only your local copy of the app, not the app itself, and that uninstalling also removes the policies you set, which loosens your security controls. Uninstalling in the middle of an incident removes the very policy controls you need.
Step 3: revoke refresh and access tokens
There are three ways to revoke tokens. Use whichever is fastest for you and confirm with a second method.
Revoke All from the usage drill-down
On the Connected Apps User's Usage page for the app, the packaging guide describes a Revoke action to end one user's access and a Revoke All action at the top of the page that logs out everyone currently using the app. Use Revoke All for the suspect app, then confirm the user list is empty.
Revoke on the user detail page
Salesforce documentation states that tokens can be revoked on a user's detail page under OAuth Connected Apps, or on the OAuth Connected Apps Usage Setup page. On the integration user's record, click Revoke beside every entry for the suspect app. Salesforce says that after you revoke the app, it can no longer access your Salesforce data. Repeat for any other user who authorised the app.
Revoke through the OAuth revocation endpoint
If you hold token values (for example, your own integration's tokens, or tokens the vendor has shared with you for revocation), call the revocation endpoint. Salesforce documents it as a POST to https://MyDomainName.my.salesforce.com/services/oauth2/revoke with Content-Type: application/x-www-form-urlencoded and a body parameter token. Sandboxes use MyDomainName--SandboxName.sandbox.my.salesforce.com.
The behaviour depends on the token type. For an access token, Salesforce invalidates and revokes that token. For a refresh token, Salesforce revokes the refresh token and all associated access tokens. Always revoke the refresh token where you have it. A successful request returns HTTP 200; errors return HTTP 400 with unsupported_token_type or invalid_token. The endpoint follows the pattern of RFC 7009 OAuth 2.0 Token Revocation, so most OAuth libraries already support it.
An illustrative request, with placeholders only:
curl -X POST https://MyDomainName.my.salesforce.com/services/oauth2/revoke -H "Content-Type: application/x-www-form-urlencoded" -d "token=REFRESH_TOKEN_VALUE"
Step 4: contain the integration user
Revoking grants removes the current tokens. It does not remove the user whose permissions those tokens carried, and it does not stop someone who also holds that user's password, a certificate, or another app's grant. Treat the integration user as compromised:
- Freeze or deactivate the user if the integration can be paused. If other integrations share the same user, that is a finding in itself; contain it and split them afterwards.
- Reset the password and any security token, and replace any certificate or private key the integration used for the JWT bearer flow. Rotating the connected app's consumer secret is a sensible additional step where your own team owns the connected app.
- Review the permission sets and profile assigned to the user. Any broad data access, API and export permissions define the worst-case scope of what may have been read or changed.
- Check whether the user created other connected apps, other users, or new permission set assignments while it was compromised. Attackers with administrative scopes may try to add persistence.
- Check for other connected apps authorised by the same user, because a compromised vendor may operate several.
Step 5: tighten connected app policies before restoring
Before the business asks for the integration back, change the app's policies through Manage App Policies and Edit Policies so that any reinstatement is narrower than before.
- Permitted Users. Set "Admin approved users are pre-authorized" and assign access only through a dedicated permission set for the single integration user. This prevents ordinary users from self-authorising the app again.
- Refresh token policy. Salesforce offers several policies. The default is that refresh tokens are valid until revoked. Alternatives include "Immediately expire refresh token", "Expire refresh token if not used for n" and "Expire refresh token after n". Salesforce notes that the refresh token policy is evaluated only when the token is used, so it does not affect a current session. For a restored integration, an inactivity or fixed lifetime limits how long a stolen token remains useful.
- Scopes. Ask the vendor for the minimum OAuth scopes and confirm the app does not request full access or offline access it does not need.
- Network restrictions. Where the vendor publishes fixed egress addresses, enforce login IP ranges for the integration user so that a stolen token used from elsewhere fails.
If you are planning the longer-term move away from legacy connected apps, the Salesforce External Client Apps guide covers migration.
Step 6: verify the cut and scope the exposure
An emergency revoke is not finished until you can show that it worked.
- Usage counts. Return to the Connected Apps OAuth Usage page and confirm the User Count for the suspect app is zero and the app shows as blocked.
- Token test. If you hold a token value from your own integration, call any simple API with it and confirm it is rejected. A repeated revocation call returning
invalid_tokenis consistent with the token already being revoked. - Failed attempts. Because Use Count and Last Used are updated even when an app fails to log in, rising counts after the cut indicate that someone is still trying to use the app. That is useful intelligence: record the times and correlate with login history.
- Activity review. For the window from the earliest suspected exposure to the cut, review API calls, report exports and bulk jobs run by the integration user. The Salesforce Org Compromise Playbook covers evidence preservation and notification triggers in depth, so it is not repeated here.
- Secrets in data. If the integration read objects where staff paste credentials (cases, notes, custom fields), treat those secrets as exposed and rotate them in the systems they belong to.
Restoring the integration safely
Restore only when three conditions hold: the vendor has confirmed what was exposed and that its token store has been rebuilt; new credentials have been issued under the tightened policies; and a named owner in your organisation accepts the residual risk. Then unblock the app, have the integration user (and only that user) authorise it once, and watch the first day of activity closely against the baseline you recorded in the evidence step.
Keep the incident record: which app, which users, which tokens, when each action happened, and who approved the restore. That record is what auditors and regulators will ask for, and it is the input for the routine review cycle that should follow.
Common failure patterns
- Block without revoke. The app is blocked, the incident is closed, and a later Unblock restores the same grants. Always revoke tokens as a separate, recorded step.
- Revoking the access token only. The refresh token remains valid under the default policy and quietly mints new access tokens. Revoke refresh tokens.
- Missing duplicate grants. A user can hold several approvals for the same app. Revoking the first entry leaves others live.
- Uninstalling to "remove" the app. This drops your local policies while the app itself remains, which loosens controls at exactly the wrong time.
- Ignoring the integration user. Its password, security token, certificates and other app grants are still valid after the connected app is cut.
- Shared integration users. Several vendors share one user, so containment for one breaks the others and the business pushes for a fast, unsafe restore.
- Self-authorised apps. Permitted Users was left open to self-authorisation, so an attacker who persuades a staff member to approve an app gains a new grant without any administrator involvement.
- No permissions on call. The on-call administrator lacks Manage Users or Manage Connected Apps and loses time finding someone who has them.
Practitioner checklist
- Confirm on-call administrators hold View Setup and Configuration, Manage Users and Manage Connected Apps.
- Export the Connected Apps OAuth Usage page and the User's Usage drill-down before changing anything.
- Block the suspect connected app.
- Use Revoke All on the app's usage page, then revoke every entry on each affected user's OAuth Connected Apps list.
- Revoke any held refresh tokens through
/services/oauth2/revokeand record the HTTP responses. - Freeze or deactivate the integration user and reset its password, security token and certificates.
- Review the integration user's permission sets and look for new apps, users or assignments it created.
- Set Permitted Users to admin approved, pick a refresh token expiry policy and narrow scopes before restoring.
- Verify User Count is zero and watch Use Count and Last Used for continued attempts.
- Record every action, time and approver, and schedule a full connected app review once the incident closes.
Standards and references
- Salesforce Help: Revoke OAuth Tokens (revocation endpoint, token type behaviour and errors)
- Salesforce Help: Manage OAuth Access Policies for a Connected App (refresh token policies)
- Salesforce Help: Manage OAuth Connected Apps for a user (approvals, Use Count and Last Used)
- Salesforce Developers: Monitor Usage for an OAuth Connected App (Block, Revoke All, Uninstall; archived release version)
- IETF: RFC 7009 OAuth 2.0 Token Revocation
- MITRE ATT&CK: Steal Application Access Token (T1528)
- MITRE ATT&CK: Application Access Token (T1550.001)
- NIST SP 800-53 Rev. 5 (AC-2 Account Management, IA-5 Authenticator Management, IR-4 Incident Handling)
Related NHI Mgmt Group resources: How to review Salesforce connected apps and integration users · Salesforce Org Compromise Playbook · Salesforce Event Monitoring Detection Guide · Salesforce Security Guide