Appearance
Google Workspace
This guide walks you through connecting a Google Workspace domain to MyEmailVault using a service account with domain-wide delegation. This allows MyEmailVault to archive emails for all users in your organization.
The setup consists of three parts:
- Create a Google Cloud project, enable APIs, and generate a service account key.
- Grant domain-wide delegation in the Google Admin Console.
- Connect the service account in MyEmailVault.
Part 1: Google Cloud Console Setup
1.1 Create a Project
- Go to the Google Cloud Console.
- Click the project selector at the top of the page and click New Project.
- Enter a project name (e.g., "MyEmailVault") and click Create.
- Select the newly created project from the project selector.
1.2 Enable Required APIs
- Navigate to APIs & Services > Library.
- Search for and enable the following APIs:
- Gmail API
- Admin SDK API
1.3 Create a Service Account
- Navigate to APIs & Services > Credentials.
- Click Create Credentials and select Service Account.
- Enter a name (e.g., "MyEmailVault Service Account") and click Create and Continue.
- You may skip the optional "Grant this service account access to project" and "Grant users access to this service account" steps. Click Done.
1.4 Generate a JSON Key
- On the Credentials page, click on the service account you just created.
- Go to the Keys tab.
- Click Add Key > Create New Key.
- Select JSON and click Create.
- The JSON key file will be downloaded to your computer. Keep this file secure -- it grants access to your organization's email.
Troubleshooting: Key Creation Disabled
If you see an error such as iam.disableServiceAccountKeyCreation, your organization has an Organization Policy that blocks service account key creation.
To resolve this:
- Go to the Organization Policies page in the Google Cloud Console.
- Search for
iam.disableServiceAccountKeyCreation. - Click on the policy, then click Manage Policy.
- Click Override parent's policy.
- Under Rules, click Add Rule.
- Set Enforcement to Off and click Done, then Set Policy.
- Return to your service account and try creating the key again.
- After downloading the key, you may re-enable the policy for security.
Part 2: Domain-Wide Delegation in Google Admin Console
2.1 Get the Service Account Client ID
- In the Google Cloud Console, go to IAM & Admin > Service Accounts.
- Click on your service account.
- Copy the Unique ID (also called the Client ID). This is a numeric string (e.g.,
123456789012345678901).
2.2 Enable Domain-Wide Delegation
- On the same service account details page, check the box Enable Google Workspace Domain-wide Delegation if it is not already enabled. If this option is not visible, expand the Show Advanced Settings section.
2.3 Authorize Scopes in the Admin Console
- Go to the Google Admin Console.
- Navigate to Security > Access and data control > API Controls.
- Click Manage Domain Wide Delegation.
- Click Add new.
- In the Client ID field, paste the service account Client ID from the previous step.
- In the OAuth Scopes field, enter the following scopes (comma-separated):
https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/admin.directory.user.readonly- Click Authorize.
Part 3: Connect in MyEmailVault
3.1 Create an Ingestion Source
- In MyEmailVault, navigate to Ingestions and click Create New.
- Select Google Workspace as the provider.
- Enter a descriptive Name for this source (e.g., "Company Google Workspace").
3.2 Upload the Service Account Key
Upload or paste the contents of the JSON key file you downloaded in Part 1.
3.3 Enter the Admin Email
Enter the email address of a Google Workspace admin user. The service account will impersonate this user to list the users in your domain. This should be a super admin or an account with the necessary privileges to read the directory.
3.4 Save
Click Save to create the ingestion source.
What Happens Next
After saving, MyEmailVault will:
- Authenticate using the service account credentials.
- List all users in your Google Workspace domain.
- Begin importing emails from each user's mailbox.
The source status will show Importing during the initial bulk import. Once complete, it will transition to Active and MyEmailVault will continuously sync new emails as they arrive.
You can monitor import progress on the Ingestions page. Individual user mailboxes within the source will each show their own sync status.