When a third-party OAuth app connected to Google Workspace turns malicious or is itself compromised, you need to block it for the whole organisation and remove every token users have already granted, in that order and with proof that both steps worked. This guide sets out a response procedure for Google Workspace administrators and incident responders: confirm the app's identity, block it in API controls, find every user who authorised it, revoke their tokens through the Admin SDK Directory API, and verify the result in the OAuth Token audit log. It assumes you already know which app is the problem; if you are still building a picture of what is connected, start with the inventory guide linked below.
OAuth apps are non-human identities. Each one holds delegated access to user data through tokens that keep working after the user who consented has forgotten about the app, and often after a password change. The 2025 Salesloft Drift breach showed how stolen tokens from a single integration can open many customer tenants at once, and the response for every affected organisation came down to the same question: how fast could they revoke and block the integration everywhere?
This is an independent guide from NHI Mgmt Group, based on Google's public Workspace documentation as of November 2026. It is not sponsored or reviewed by Google. Product features change, so confirm settings against Google's current documentation.
Key takeaways
- Work with the app's OAuth client ID, not its display name. Names can be duplicated or spoofed; the client ID is what both API controls and the Directory API use.
- Block first, then revoke. Setting the app to Blocked in API controls stops it reaching any Google service. Google's documentation does not state that blocking an individual app revokes tokens already granted, so revoke them explicitly.
- Revocation is per user:
DELETE https://admin.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}deletes all access tokens a user has issued to that application. - Find affected users from two sources: the OAuth Token audit log (
authorizeevents with the app'sclient_id) and a per-usertokens.listsweep. - Verify with
revokeevents in the OAuth Token audit log and an emptytokens.listresult, and allow for the documented delay before the accessed apps list in the Admin console catches up. - Blocking stops future access to Google; it does nothing about data the app has already copied. Run a parallel investigation of what the app accessed.
When you need this procedure
Use this procedure in any of these situations:
- A vendor discloses that its OAuth integration, or the infrastructure holding its tokens, has been compromised.
- Threat intelligence or a security advisory names a client ID or app as malicious.
- Your own review finds a consent phishing app: an app with a plausible name, few users and broad scopes such as mail or Drive access. The Consent Phishing and Illicit OAuth Grants Guide covers how those campaigns work.
- An app is no longer approved, its vendor relationship has ended, or its scopes exceed what the business owner signed off.
The urgency differs. A confirmed compromise justifies blocking immediately and accepting some business disruption. A risky but not malicious app can be blocked on a planned date after the owner has been told. The steps are the same either way.
Before you start
Gather the following before you change anything, because several of these items are needed for evidence and cannot be recreated afterwards:
- Admin privilege. Google documents that managing API controls requires the Service Settings administrator privilege. Revoking user tokens through the Directory API requires the
https://www.googleapis.com/auth/admin.directory.user.securityauthorisation scope. - The client ID. Take it from the vendor's disclosure, from the Configured apps list, or from OAuth Token audit events. If the vendor operates several client IDs (for example separate web, Android and iOS clients), collect all of them.
- An evidence export. Export OAuth Token audit events for the client ID for the longest period your retention allows, including
authorize,revokeandrequestevents. Keep the raw output. - A business owner and communication plan. Know who uses the app and who will tell them it is being removed. A sudden block without warning generates help desk volume and, worse, users who try to reconnect the app under another account.
- A view of domain-wide delegation. Check whether the same vendor has a service account with domain-wide delegation in your tenant. That access does not depend on user tokens and must be handled separately (see below).
Step 1: confirm the app's identity and scope
In the Admin console go to Security, Access and data control, API controls. Under App access control, click Manage Third-Party App Access. The Configured apps list can be filtered by app name, type, ID, verified status or access, which lets you search for the client ID directly.
Record the app's current access setting and how many users it shows. Then check the OAuth Token audit events. Google documents three events for this log:
| Event | Google description |
|---|---|
authorize | A user authorized access to an application for their data. |
revoke | Access revoked for an application to a users data. |
request | Access requested for an application. |
Each event carries app_name, client_id, scope and client_type. Compare the scopes in recent authorize events with the scopes the vendor says the app needs. A change in requested scopes over time, or scopes that do not match the app's stated function, strengthens the case for blocking. Note the client_type values too, because a vendor with web and mobile clients may appear under more than one ID.
The guide to inventorying third-party OAuth apps in Google Workspace covers building the full inventory; for a response you need only this app.
Step 2: block the app tenant-wide
Blocking first means that, while you are revoking tokens user by user, no new grant can succeed and the app cannot use Google services. In Configured apps, click View list, point to the app and click Change access, choose Blocked and click Change. Google describes Blocked as no access to any Google service. Google also notes that if an app is on a device allowlist but blocked in API controls, it stays blocked.
If the app is not yet in the Configured apps list, add it: click Add app, choose OAuth App Name or Client ID (or Android or IOS for mobile clients), search, select it, choose Blocked and click Configure. Searching by client ID rather than name avoids blocking the wrong app.
Repeat for every client ID the vendor uses. Record the time of each change; the Admin audit log will also record it, and you will want both for the incident timeline.
Tighten the default while you respond
If the incident involves consent phishing, or you suspect lookalike apps, review the setting for unconfigured third-party apps in the Settings card. The options include Allow users to access third-party apps that only ask for Google sign-in info and Don't allow users to access any third-party apps (the wording differs slightly in Education editions). Google notes that blocking all third-party API access also stops users signing in with Google to third-party apps, while apps set to Trusted or Limited keep working. Treat this as a deliberate policy decision with the business, not a reflex, but it is the fastest way to stop a campaign that rotates client IDs.
A related lever is restricting Google services. Under Manage Google Services, setting a service such as Gmail or Drive to Restricted means only apps you have marked Trusted can reach it. Google documents that switching a service to Restricted stops previously installed untrusted apps and revokes their tokens. That is a broad change affecting every untrusted app using the service, so use it only when you have an up-to-date trusted list.
Step 3: find every user who granted access
Revocation is done per user, so you need a complete list of users who hold a token for the client ID. Build it from two sources and reconcile them:
- OAuth Token audit log. Every
authorizeevent for the client ID names a user. This covers grants within your log retention period. - Directory API sweep. The Directory API
tokens.listmethod returns the set of tokens a specified user has issued to third-party applications. Each Token resource includesclientId,displayText,scopes,anonymous,nativeAppanduserKey. Iteratingtokens.listacross all users catches grants older than your audit retention.
For a large organisation the sweep takes time and consumes API quota, so script it with back-off and run it from an administrative service account or admin session that is itself tightly controlled. Store the per-user results; they are evidence of who was exposed, and the scopes field tells you what data each user's token could reach.
Also note any tokens where anonymous is true, which Google uses to indicate a client ID not registered with Google. These deserve extra scrutiny whatever app you are responding to.
Step 4: revoke tokens for every affected user
For each user on the list, call the Directory API tokens.delete method:
DELETE https://admin.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}
userKey accepts the user's primary email, an alias email or the unique user ID, and clientId is the client ID of the application the token was issued to. Google describes this method as deleting all access tokens issued by a user for an application, so one call per user per client ID is enough.
Run the revocation as a script that logs each user, client ID, response code and timestamp. Retry failures and keep a list of users you could not process, for example suspended accounts, so they can be handled manually. At incident scale, scripting the API is the practical route.
This step matters even after blocking. Google's documentation describes the effect of Blocked as no access to any Google service, but it does not say that blocking an individual app deletes tokens already issued. Explicit revocation removes any doubt and means that if the block is later lifted by mistake, old tokens do not come back to life. RFC 7009 describes token revocation in general OAuth terms; in Workspace the Directory API is how administrators trigger it on users' behalf.
Step 5: handle domain-wide delegation and related access
Many SaaS integrations connect to Workspace in more than one way. A vendor may use per-user OAuth for some features and a service account with domain-wide delegation for others. Domain-wide delegation lets a service account act as users without per-user consent, so revoking user tokens and blocking the OAuth client does not touch it.
In the domain-wide delegation settings (Google documents these separately under controlling API access with domain-wide delegation), review entries for any client ID belonging to the vendor and remove those that relate to the incident. Then check the vendor's other footholds: shared drives where its service account was added, Apps Script projects that call its APIs, and Gmail routing or forwarding rules created during the integration's lifetime. Treat every one of these as a separate non-human identity to retire.
Finally, remember that the compromised vendor may hold credentials for systems other than Google. In the Salesloft Drift case the stolen tokens were used against connected platforms; the UNC6395 threat actor profile summarises the behaviour defenders saw. Coordinate with the owners of every connected platform so that revocation happens everywhere at once.
Step 6: verify and monitor
Verification has three parts:
- Audit log. Each successful revocation should produce a
revokeevent in the OAuth Token audit log for that user and client ID. Reconcile the count ofrevokeevents with your list of affected users. - Directory API. Re-run
tokens.listfor every affected user and confirm no token for the client ID remains. - Admin console. The app should show Blocked in Configured apps. Google notes that the accessed apps list updates 48 hours after a token is granted or revoked, and details for newly authorised apps typically appear 24 to 48 hours after authorisation, so do not treat the console view as current during the first two days.
Keep an alert on authorize and request events for the blocked client ID. Repeated request events after the block show users still trying to connect, which is a communication problem, or an attacker still running a phishing campaign, which is a threat intelligence lead. Watch also for new apps with similar names or identical scopes appearing in the days after the block.
Investigate what the app reached
Blocking and revocation stop future access. They do not tell you what the app did while it had access. In parallel with the steps above, use the scopes recorded for each user to decide which audit logs to review: Gmail logs for mail scopes, Drive logs for Drive scopes, Calendar logs for calendar scopes. Look for bulk downloads, unusual sharing changes and access from the vendor's infrastructure during the exposure window. ATT&CK technique T1528 (Steal Application Access Token) describes how attackers obtain these tokens; the guide to detecting use of a stolen OAuth refresh token covers the hunt for misuse.
Record the findings in the incident file: affected users, scopes held, data accessed, time of block, time each token was revoked, and any data that may need breach notification assessment.
Rollback and common errors
If a block was applied in error, change the app's access back to its previous setting. Revoked tokens are not restored, so users will need to re-authorise the app, which is usually the safer outcome anyway. Common errors in this procedure include:
- Blocking by name. Choosing the app by display name can block a legitimate app with a similar name and leave the malicious client untouched.
- Missing secondary client IDs. Vendors with web, desktop and mobile clients have several IDs. Block and revoke all of them.
- Trusting the console list during the first 48 hours. Use the audit log and Directory API for verification instead.
- Quota failures in the sweep. Unhandled API errors leave users silently unprocessed. Log every response and reconcile at the end.
Common failure patterns
- Revoking without blocking. Users simply re-authorise the app, sometimes within hours, because their workflow depends on it.
- Blocking without revoking. The block is the control everyone sees, but existing tokens are left in place with undocumented behaviour, and the exposure list never gets built.
- Forgetting domain-wide delegation. The vendor's service account keeps acting as users long after the OAuth client is blocked.
- No owner for the app. Nobody can say what the app was meant to do, so nobody can judge whether its scopes were excessive or what data it touched.
- Single platform response. The team cleans up Google but not the other SaaS platforms the same vendor was connected to.
- No follow-up monitoring. Lookalike apps reappear and are granted by the same users who granted the first one.
Practitioner checklist
- Collect every client ID for the app and export its OAuth Token audit events.
- Confirm the app in Manage Third-Party App Access and record its current setting and scopes.
- Set every client ID to Blocked and record the times.
- Decide, with the business, whether to tighten unconfigured app access or restrict services.
- Build the affected user list from
authorizeevents and atokens.listsweep. - Call
tokens.deletefor every user and client ID; log and retry failures. - Review and remove related domain-wide delegation and other vendor footholds.
- Verify with
revokeevents and an emptytokens.list; allow 48 hours for the console. - Investigate data access by scope and record findings.
- Alert on new
requestorauthorizeevents for the client ID and on lookalike apps.
Standards and references
- Google: Control which third-party and internal apps access Google Workspace data
- Google: Directory API Tokens resource
- Google: Directory API tokens.delete
- Google: OAuth Token audit activity events
- IETF: RFC 7009 OAuth 2.0 Token Revocation
- IETF: RFC 9700 Best Current Practice for OAuth 2.0 Security
- MITRE ATT&CK: Steal Application Access Token
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
Related NHI Mgmt Group resources: How to inventory third-party OAuth apps in Google Workspace · Google Workspace Security Guide · Consent Phishing and Illicit OAuth Grants Guide · Salesloft Drift Breach 2025