Overview π₯
This error appears when the Google Cloud Services Inspectors (Google Workspace, Google Drive) attempt to retrieve access tokens but the service account is either not authorized, incorrectly scoped, or missing required IAM permissions.
β
Full Error(s):
a. Client is unauthorized to retrieve access tokens using this method Or
b. Client not authorized for any of the scopes requested.
β
This indicates a mismatch between how the Service Account was created in Google Cloud Platform (GCP) and how it was authorized in Google Workspace Admin Console.
Why Does This Happen? π€
Common root causes include:
Domain-wide delegation not enabled for the service account.
Incorrect or incomplete OAuth scopes in Google Workspace.
Service account missing required IAM roles (Service Account User + Token Creator).
Private key mismatch (uploaded wrong key, key expired, or regenerated but not updated in Liongard).
Parent/Child inspector mismatch, especially if the service account was not created in the correct GCP project tied to the correct Google Workspace organization.
Steps to Resolve π§βπ«
1οΈβ£ Ensure Domain-Wide Delegation is Enabled
In Google Cloud Platform, go to:
βIAM & Admin β Service Accounts β Your Service Account β Details β Advanced SettingsConfirm Domain-wide delegation is enabled.
Verify the Client ID β you will use this in Google Workspace OAuth setup.
For more information, reference this article from Google Cloud Platform's developer documentation
2οΈβ£ Confirm OAuth Scopes Are Correct in Google Workspace
Scopes must match exactly as documented. In Google Admin Console, Navigate to :
βSecurity β Access and data control β API Controls β Domain-wide Delegation β Manage
Check that:
The Client ID matches your service account.
The scopes list is complete and comma-separated (no trailing commas).
You're using the correct scope set depending on inspector type:
Workspace + Drive
https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.orgunit.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly, https://www.googleapis.com/auth/admin.directory.userschema.readonly, https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly, https://www.googleapis.com/auth/admin.directory.device.mobile.readonly, https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly, https://www.googleapis.com/auth/admin.reports.audit.readonly, https://www.googleapis.com/auth/admin.reports.usage.readonly, https://www.googleapis.com/auth/apps.order.readonly, https://www.googleapis.com/auth/calendar.readonly, https://www.googleapis.com/auth/calendar.events.readonly, https://www.googleapis.com/auth/calendar.settings.readonly, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/drive.activity.readonly, https://www.googleapis.com/auth/apps.licensing
Drive-only
https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/apps.order.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly,
3οΈβ£ Validate Required IAM Roles in Google Cloud Platform
Your service account requires:
Required Role | Purpose |
Service Account User | Allows impersonation for API calls |
Service Account Token Creator | Allows minting OAuth tokens |
Navigate to IAM & Admin β IAM β Select your Service Account β Permissions
Ensure both roles appear.
If not: Add β Service Accounts β select both roles.
4οΈβ£ Verify the Correct Private Key Is Loaded in Liongard
Common issue: a new JSON key is generated but Liongard still uses the old key.
Steps:
Open the JSON private key file downloaded during service account creation.
In Liongard, open the Parent Inspector.
Paste the entire JSON file contents into the Private Key field.
If youβre unsure which key is active β regenerate a new JSON key and update Liongard with it.
5οΈβ£ Reconfirm Required APIs Are Enabled in GCP
Navigate to: APIs & Services β Enabled APIs & Services
Verify:
API | Workspace | Drive | Full Suite |
Admin SDK API | β | β | β |
Google Drive API | π | β | β |
Enterprise License Manager | β | π | β |
Google Workspace Reseller API (optional) | β | β | β |
If any API is missing β Enable and re-run inspection.
Advanced Troubleshooting π¨βπ»
These steps help when everything appears correct but the inspector still fails.
β Run Inspector in Clear Cache + Debug Mode
Run Parent Inspector in Clear Cache + Debug Mode.
Download the debug logs.
Look for:
invalid_grantunauthorized_clientmissing_scopeserviceAccountTokenCreationPermissionDenied
These messages pinpoint the exact missing permission/scope.
β Validate the Service Account Is Created in the Correct Project
If the service account is created under the wrong GCP Organization, domain-wide delegation will fail silently.
Verify that:
The project belongs to the same Google Workspace org you're inspecting.
The Parent Inspector's admin email matches a Super Admin in that Workspace tenant.
β Confirm Parent vs. Child Inspector Setup
For multi-tenant setups:
Only one Parent Inspector should be created.
Child inspectors are auto-discovered.
Children inherit the same service account used by the Parent.
If Parent is configured incorrectly β all children will fail.
β Confirm Time Sync Issue (rare but known Google cause)
Google may rejects service-account-issued tokens if Local system time is off by more than 5 minutes. Correct time drift and try running inspection again.
Post-Resolution Validation
After changes:
Re-run Parent Inspector.
Ensure auto-discovered Child Inspectors appear.
Confirm:
Google Workspace retrieves user, group & other data.
Google Drive retrieves file statistics and drive metadata.
Check for β
insufficientPermissionsβ or βforbiddenβ errors in the logs.
Contact Support π¦
After performing all steps above if issue still persist, contact Liongard Support with:
Parent Inspector Debug Logs
Confirmation of Domain-wide Delegation
Service Account IAM role screenshot
Scope entry screenshot from Workspace Admin Console
Enabled APIs screenshot
Our Support team is happy to help π
π¬ Start a chat with Leo (Our AI Assistant) or connect with a live support engineer.
π§ Email: support@liongard.com

