Office Consumer is reader-supported. We may earn an affiliate commission from qualified links on our site.

How to Enable Google Workspace Domain-Wide Delegation (w/Examples) + FAQs

Enabling Google Workspace Domain-Wide Delegation (DWD) lets a service account act on behalf of any user in your domain, and you turn it on inside the Admin Console API controls page by pasting the service account’s OAuth client ID and mapping it to exact OAuth scopes. This feature is powerful because it hands a non-human identity the same reach as a human user, which is why Google and federal regulators treat a misconfigured DWD grant as one of the highest-risk settings in a tenant.

The governing rules come from Google’s own Admin SDK authorization model, overlaid with U.S. laws such as HIPAA’s Security Rule at 45 CFR 164.312, the Gramm-Leach-Bliley Safeguards Rule, SEC Rule 17a-4 for broker-dealers, and the FTC Act’s Section 5 authority used against firms with weak access controls. Violating these rules can trigger civil monetary penalties, consent decrees, or customer notification duties under state laws like the California CPRA.

A recent Mandiant M-Trends 2024 report found the median dwell time for attackers abusing cloud identity tokens was 10 days, and Google’s own threat research has repeatedly flagged DWD as a top lateral-movement target after the 2023 Storm-0558 token-forging incident.

Here is what you will learn in this guide:

  • ๐Ÿ”‘ How to create a service account, capture the client ID, and map scopes inside the Admin Console.
  • ๐Ÿ›ก๏ธ How HIPAA, GLBA, SOX, FERPA, CCPA, and SEC 17a-4 shape your scope choices.
  • ๐Ÿงช Three real-world named scenarios covering Gmail archiving, Drive DLP, and HRIS calendar sync.
  • โš ๏ธ The seven biggest mistakes admins make and the breach, fine, or outage each one causes.
  • ๐Ÿ“‹ A copy-ready do’s and don’ts list plus a scope cheat sheet built around the Google OAuth scopes reference.

What Domain-Wide Delegation Actually Is

Domain-Wide Delegation is a Google Workspace feature that lets a Google Cloud service account use the OAuth 2.0 JWT bearer flow to impersonate any user in your domain without that user clicking “Allow.” The service account becomes a deputy for the entire tenant, which is why security researchers call the misuse pattern the confused deputy problem described in the classic NIST computer security literature.

The what is a trust link between one Google Cloud service account and one Google Workspace tenant. The where lives in two consoles at once, the Google Cloud IAM page that creates the account and the Workspace Admin API controls that authorizes it. The when is any time your app must read or write data across many mailboxes, drives, or calendars without per-user consent. The why is scale, because asking 10,000 employees to consent to an archiving tool is not realistic. The how is a signed JWT that names the user to impersonate in the sub claim.

The immediate consequence of enabling DWD is that anyone holding the service account’s private key can read or write data for every user under the granted scopes. Losing that key is treated by the FTC Safeguards Rule as a failure to maintain reasonable access controls, and HIPAA’s Breach Notification Rule can require notifying every affected patient if protected health information was within scope.

A plain-English way to picture this is that DWD hands a robot a master key to the whole building. The robot will not use the key unless told to, but a thief who steals the robot inherits the master key. The common misconception is that adding a scope like gmail.readonly only lets the app read one mailbox. In reality, it reads every mailbox in the domain unless you restrict the service account at the user or group level with Google’s context-aware access.

Service Accounts vs. User Accounts

A service account is a non-human identity created in Google Cloud IAM that authenticates with a private key instead of a password. A user account is a human mailbox with a password, MFA, and recovery options. DWD only works with service accounts, because only service accounts can present the signed JWT that Google’s token endpoint accepts for impersonation.

The consequence of confusing the two is that admins sometimes try to delegate a regular user’s mailbox, which is a different feature called Gmail delegation and does not scale. A common misconception is that disabling the human user who created the service account disables the service account. It does not, because the service account is owned by the Cloud project, not the human.

The OAuth Scope Contract

Every DWD grant is a pair, the client ID and a comma-separated list of OAuth scopes. Google divides scopes into non-sensitive, sensitive, and restricted tiers, and the restricted tier, which includes full Gmail and full Drive, requires annual third-party CASA security assessments if you ship the app to external customers.

The consequence of asking for a broader scope than you need is that the next Google app verification review can reject your project and disable the integration. A real example is a startup that listed https://mail.google.com/ when it only needed gmail.send, and lost production access for 14 days during re-review. The misconception is that scopes inherit, meaning many admins assume drive.readonly covers drive.metadata.readonly. It does, but drive.file does not cover drive.readonly, and the token request fails silently with an unauthorized_client error.

Step-by-Step: Enabling Domain-Wide Delegation in 2026

The 2026 Admin Console flow lives under Security > Access and data control > API controls > Domain-wide delegation, and it replaced the legacy “Manage OAuth Client Access” page that Google retired in 2022. The steps below assume a Google Workspace Business Plus or Enterprise tier and a super admin role, because editor and standard admin roles cannot write to the DWD list.

Step 1 โ€” Create the Google Cloud Project and Service Account

Open the Google Cloud Console and click New Project. Name the project something auditable like acme-gmail-archive-prod so your SOC team can trace it later. Navigate to IAM & Admin > Service Accounts, click Create Service Account, and give it a descriptive name plus a short description that names the business owner.

The consequence of skipping naming discipline is that a year later nobody remembers which project owns which key, and your SOC 2 Type II auditor flags it as a control deficiency. A real example is Priya Natarajan, a platform engineer at a 900-seat fintech, who inherited six unnamed service accounts and spent three weeks correlating Cloud audit logs to figure out which one her archiver used. The misconception is that you need one Google Cloud project per service account. You do not, but co-locating unrelated service accounts in one project violates the Google Cloud least-privilege guidance.

Step 2 โ€” Generate and Store the Private Key

Inside the service account, click Keys > Add Key > Create New Key > JSON. Your browser downloads a JSON file containing the private_key and client_email. Treat this file the way you treat a root password, because it is one.

The consequence of committing this file to GitHub is near-instant compromise, since GitHub’s secret scanning alerts Google within seconds and threat actors scrape public repos within minutes. Store the key in Google Secret Manager, HashiCorp Vault, or AWS Secrets Manager with rotation enabled. A real example is Marcus Holloway, a DevOps lead at a regional hospital, who pushed a key to a private repo that later went public, and the resulting PHI exposure triggered an OCR HIPAA investigation. The misconception is that private repos are safe. They are until someone flips visibility or a contractor forks them.

Step 3 โ€” Enable Domain-Wide Delegation on the Service Account

In the service account details page, click Show Advanced Settings and copy the OAuth 2 Client ID, which is a 21-digit number. This is the ID you will paste into the Admin Console. In older UIs you had to check a box labeled “Enable G Suite Domain-wide Delegation,” but in the 2026 console that checkbox is gone and any service account can be delegated as long as an admin authorizes its client ID.

The consequence of using the wrong ID, such as the service account email or the project number, is a silent unauthorized_client: Client is unauthorized to retrieve access tokens using this method error from Google’s token endpoint described in the Google auth error reference. A common misconception is that the client ID and the service account email are interchangeable. They are not, and the Admin Console only accepts the numeric client ID.

Step 4 โ€” Authorize the Client ID in the Workspace Admin Console

Sign into admin.google.com as a super admin. Go to Security > Access and data control > API controls, scroll to Domain-wide delegation, and click Add new. Paste the numeric client ID, then paste a comma-separated list of OAuth scopes in the OAuth scopes field. Click Authorize.

The consequence of pasting a scope with a trailing space or a typo is that the token request fails with access_denied and the app developer spends hours debugging. A real example is Elena Rodriguez, a Workspace admin at a 4,000-seat university, who pasted https://www.googleapis.com/auth/gmail.readonly with a trailing space, and the entire email archiver broke for 48 hours. The misconception is that Google normalizes whitespace. It does not, and the scope string must match character-for-character.

Step 5 โ€” Test With a Signed JWT Impersonation Call

Use the Google Auth Library to build a JWT with iss set to the service account email, sub set to the target user, scope set to your authorized scopes, and aud set to https://oauth2.googleapis.com/token. Post it to the token endpoint and you should receive an access token within 300 milliseconds.

The consequence of skipping the test is shipping to production with a broken grant, which then triggers pager alerts at 2 a.m. A real example is Tomoko Ishida, an SRE at a SaaS vendor, who deployed a Drive DLP scanner without a smoke test and discovered in production that she had authorized drive.metadata.readonly instead of drive.readonly. The misconception is that Google’s Admin Console shows you a success state after “Authorize.” It shows the grant exists, not that it works.

Three Real-World Scenarios

Scenario 1 โ€” Gmail Archiving for SEC 17a-4 Compliance

A broker-dealer must preserve every inbound and outbound email in a non-rewritable format under SEC Rule 17a-4 and FINRA Rule 4511. DWD lets a vendor like Smarsh or Global Relay pull every mailbox nightly.

Admin ActionRegulatory Consequence
Grant gmail.readonly to the archiver’s client IDThe firm meets WORM preservation under 17a-4(f)
Skip DWD and rely on per-user OAuth consentUsers revoke consent, gaps appear, FINRA fines up to $15,000 per violation
Rotate the archiver’s key every 90 daysMeets the FTC Safeguards Rule access-control element
Forget to remove the grant when the contract endsFormer vendor retains mailbox read access, triggering breach notice duties

Scenario 2 โ€” Drive Data Loss Prevention Scanning

A healthcare SaaS must scan Google Drive for PHI to comply with the HIPAA Security Rule. A tool like Nightfall or Google’s native DLP uses DWD with drive.readonly.

Scanner BehaviorPrivacy Consequence
Uses drive.file scope onlyMisses files the app did not create, leaving PHI undetected
Uses drive.readonly scopeFull visibility, meets HIPAA 164.312(b) audit controls
Logs file contents to a third regionPossible cross-border transfer issue under state privacy laws
Alerts admins within 24 hours of a findingSupports HHS 60-day breach notification clock

Scenario 3 โ€” HRIS Calendar Sync for Onboarding

An HRIS platform such as Workday or BambooHR syncs onboarding meetings into every new hire’s Google Calendar using calendar.events and admin.directory.user.readonly.

Sync StepOperational Consequence
Authorize both scopes togetherNew-hire calendars populate on day one
Authorize only calendar.eventsDirectory lookups fail, invites send to stale addresses
Forget to restrict impersonation to HR OUAny HRIS bug can write to executive calendars
Audit sync logs weekly in Cloud Audit LogsDetects drift before SOX 404 testing

Mistakes to Avoid

  1. Granting restricted scopes “just in case” โ€” The negative outcome is a failed CASA assessment and loss of Google app verification.
  2. Sharing one service account across unrelated apps โ€” The blast radius on a key leak grows from one product to many, and forensic triage under an OCR audit becomes near-impossible.
  3. Skipping key rotation โ€” Violates the 90-day rotation norm in NIST SP 800-57 and many cyber-insurance policies now refuse claims without it.
  4. Storing the JSON key in source code โ€” GitHub secret scanning or an attacker’s grep finds it within hours, triggering mass mailbox exfiltration.
  5. Not removing grants after vendor churn โ€” Former vendors keep read access, which state AGs treat as a Section 5 unfair practice when discovered.
  6. Using personal admin accounts to create service accounts โ€” When that admin leaves, ownership is murky and the Cloud Identity audit log points at a ghost.
  7. Forgetting to log impersonation events โ€” SOX 404 internal controls testing will flag missing access logs as a material weakness.
  8. Confusing drive.file with drive โ€” The narrower scope silently skips files and creates a false sense of DLP coverage.
  9. Authorizing scopes with trailing whitespace โ€” The grant looks valid in the UI but every token request returns access_denied.
  10. Assuming MFA protects the service account โ€” It does not, because service accounts do not prompt for MFA, so key security is the only control.

Do’s and Don’ts

Do’s
– Do create one service account per business use case, because blast-radius math is simpler when an incident happens.
– Do store every private key in a managed secret store, because rotation and revocation become one-click operations.
– Do map scopes to the narrowest set documented in the Google scopes list, because broader scopes trigger app verification reviews.
– Do restrict impersonation to an OU or group with context-aware access, because it limits what a stolen key can reach.
– Do review all DWD grants quarterly inside the Admin Console, because stale grants are the single most common audit finding.

Don’ts
– Don’t reuse a Google Cloud project across business units, because IAM bleed-through happens fast.
– Don’t grant https://mail.google.com/ when gmail.readonly works, because the full-access scope is restricted and costly to keep.
– Don’t allow developers super admin rights just to manage DWD, because least privilege under NIST 800-53 AC-6 forbids it.
– Don’t document keys in Confluence or Notion, because wiki search indexes them and insider-threat models treat them as public.
– Don’t ignore Google’s alert center notifications about token anomalies, because they usually precede confirmed breaches.

Pros and Cons of Domain-Wide Delegation

Pros
– Scales to thousands of users without human consent friction, which cuts onboarding time by weeks.
– Enables tenant-wide archiving required by SEC 17a-4 and FINRA 4511, which manual consent cannot satisfy.
– Works with any Google API that accepts OAuth, so the pattern is reusable across Gmail, Drive, Calendar, and the Admin SDK.
– Centralizes authorization in one Admin Console page, making audits faster than reviewing thousands of user consents.
– Supports automation in CI/CD pipelines, because service accounts can present keys where humans cannot enter passwords.

Cons
– One leaked key compromises the whole domain, so the risk profile is catastrophic rather than limited.
– Users cannot see or revoke the grant from their account page, which some privacy teams view as a consent-transparency gap under the CCPA consumer rights framework.
– Restricted scopes require annual CASA assessments, which add cost for SaaS vendors.
– The feature is invisible to end users, which makes insider misuse harder to detect without dedicated log monitoring.
– Errors are silent, because misconfigured scopes return generic access_denied codes that slow down troubleshooting.

How U.S. Law Shapes Your DWD Decisions

Federal law does not mention DWD by name, but it governs the data that flows through it. HIPAA’s Security Rule at 45 CFR 164.308(a)(4) requires information access management, which the HHS Office for Civil Rights reads to include service account scope minimization. The consequence of a HIPAA violation tied to an over-scoped service account is a civil monetary penalty of up to $2.13 million per violation category per year under the 2024 OCR penalty schedule.

GLBA’s Safeguards Rule now requires covered financial institutions to designate a qualified individual, inventory information systems, and document access controls. A service account with gmail.readonly across every mailbox is an information system under the rule, and the FTC has brought enforcement actions against firms that could not produce an access-control inventory.

SOX Section 404 internal controls testing treats any system of record as in-scope, and a DWD-enabled archiver that touches financial email is unambiguously in-scope. Missing access logs are a material weakness that external auditors must disclose under PCAOB AS 2201. FERPA applies to K-12 and higher-ed tenants, and unauthorized disclosure of student records through a rogue service account can cost a school its federal funding under 20 USC 1232g.

State law adds a second layer. The California CPRA requires reasonable security, which state AGs have interpreted to include credential rotation. The New York SHIELD Act imposes similar duties. A common misconception is that B2B data is exempt. It is not under CPRA after 2023, and a DWD leak exposing business contact data can trigger consumer notice duties.

Recap of Relevant Rulings and Enforcement Actions

The FTC’s 2023 consent order against Drizly penalized the company for failing to limit employee access to consumer data, a principle that applies directly to over-scoped service accounts. The SEC’s 2023 enforcement sweep against off-channel communications reinforced that every message must be captured, and DWD archiving is the scalable way to meet this. The HHS OCR settlement with Anthem for $16 million flowed from weak access controls that an attacker used to pivot between internal systems, the same pivot pattern DWD amplifies.

Key Entities You Should Know

  • Google Workspace Admin Console is where DWD grants live, and the super admin role is required to edit them through admin.google.com.
  • Google Cloud IAM is where service accounts are born, and it owns the private keys through console.cloud.google.com.
  • OAuth 2.0 Token Endpoint at oauth2.googleapis.com/token is the server that accepts signed JWTs and returns access tokens under the Google OAuth docs.
  • App Defense Alliance CASA is the third-party body that assesses restricted-scope apps annually through appdefensealliance.dev.
  • HHS Office for Civil Rights enforces HIPAA and has published specific guidance on cloud service provider obligations.
  • FTC Division of Privacy and Identity Protection enforces GLBA and Section 5 against firms with weak access controls through published enforcement actions.
  • SEC Division of Examinations runs the sweeps that find 17a-4 preservation gaps using its priorities letter.

Scope Cheat Sheet for Common Integrations

Use CaseMinimum Scope
Read email for archivinggmail.readonly per Gmail API scopes
Send mail on user’s behalfgmail.send per Gmail send docs
Read all Drive filesdrive.readonly per Drive API scopes
Create Calendar eventscalendar.events per Calendar API scopes
List users in directoryadmin.directory.user.readonly per Admin SDK scopes
Manage group membershipadmin.directory.group per Admin SDK group docs

Monitoring and Incident Response for DWD

Every impersonation event writes to Cloud Audit Logs, and you should route these to a SIEM like Chronicle or Splunk with alerts for unusual user-agent strings or unexpected geographies. The consequence of not routing these logs is that an attacker using a stolen key can read thousands of mailboxes before anyone notices, which is exactly the pattern Mandiant documented in 2024 with a median 10-day dwell time.

Incident response starts with key revocation in Cloud IAM, followed by grant removal in the Admin Console, followed by forensic review of Cloud Audit Logs and Gmail log events. Under HIPAA, the 60-day breach notification clock starts on discovery, not on containment, so document timestamps carefully. Under state laws like the Illinois Personal Information Protection Act, notice can be due in as little as 30 days for residents.

The misconception is that deleting the service account stops the bleeding. It does, but only for new token requests, because issued tokens live for up to one hour and remain valid. You must also revoke issued tokens through the revocation endpoint or wait out the token lifetime while monitoring for exfil.

FAQs

Is Domain-Wide Delegation enabled by default in Google Workspace?

No. DWD is off by default on every tenant, and a super admin must explicitly add each service account’s client ID and scope list inside the Admin Console API controls page.

Can a standard admin enable Domain-Wide Delegation?

No. Only a super admin can add, edit, or remove DWD grants, which aligns with Google’s least-privilege guidance and protects against rogue sub-admin misuse.

Does Domain-Wide Delegation require a paid Google Workspace plan?

Yes. DWD works on Business Starter and above, but restricted scopes and context-aware access features that secure it require Business Plus or Enterprise tiers.

Is Domain-Wide Delegation HIPAA compliant on its own?

No. DWD is a feature, not a compliance state, so you must sign a Google Workspace Business Associate Agreement and minimize scopes before using it with protected health information.

Can end users see that a service account is impersonating them?

No. End users do not see DWD grants in their account settings, which is why admin-side logging and quarterly reviews are non-negotiable.

Does Domain-Wide Delegation bypass Multi-Factor Authentication?

Yes. Service accounts authenticate with private keys instead of passwords, so MFA does not apply, which makes key protection the only meaningful control.

Can I restrict a service account to one organizational unit?

Yes. Context-aware access and group-based impersonation filters let you scope the service account to a specific OU, which limits the blast radius of a key compromise.

Do I need to rotate service account keys?

Yes. NIST SP 800-57 and most cyber-insurance policies expect 90-day rotation, and Google supports programmatic rotation through the Cloud IAM API.

Is Domain-Wide Delegation logged in the Admin audit trail?

Yes. Every DWD grant change appears in the Admin log events, and every impersonation call appears in Cloud Audit Logs, so auditors can reconstruct the full timeline.

Can I use Domain-Wide Delegation across two separate Workspace tenants?

No. A DWD grant lives in one tenant, so a multi-tenant vendor must create separate service accounts or per-tenant authorizations for each customer domain.

Does revoking the grant stop tokens already issued?

No. Issued access tokens remain valid for up to one hour, so you must also call the OAuth revocation endpoint or rotate the underlying private key to fully stop access.

Is Domain-Wide Delegation the same as Gmail delegation?

No. Gmail delegation is a user-to-user mailbox share feature, while DWD is a service account impersonation mechanism that operates across the entire domain.