Connect (Machine-to-Machine Authentication)

Use this guide to connect your Google Workspace account to Zluri using service account–based M2M (Machine-to-Machine) authentication with domain-wide delegation. This setup allows Zluri to fetch data for users, groups, organizational units, audit logs, and licenses from your Google Workspace environment.

Prerequisites

Before starting, ensure you have:

  • Admin access to the Google Cloud Console

  • Admin access to the Google Admin Console

  • A verified domain in Google Workspace

  • Permissions to:

    • Create and manage GCP projects
    • Create and configure service accounts
    • Enable the Admin SDK API
    • Configure organization policies (if key creation is restricted)
    • Delegate domain-wide access via Google Admin

Step 1: Access Google Cloud Console

  1. Log in to the Google Cloud Console.
  2. Click the project selector dropdown at the top.
  3. Click New Project.
  4. Enter a project name (e.g., Zluri-GW-M2M).
  5. Select your organization and location.
  6. Click Create.

Step 2: Enable Admin SDK API

  1. In the project, navigate to Menu > APIs & Services > Library.
  2. Search for Admin SDK API, open it and select Enable.
  3. Search for Enterprise License Manager API, open it and select Enable. The default apps.licensing scope calls this API.
  4. Enable any further APIs only for the optional scopes you plan to grant: Reseller API (apps.order scopes), Google Calendar API (calendar), People API (contacts scopes).
  5. Open Menu > APIs & Services > Enabled APIs & services and confirm that each API is listed.

Step 3: Create a Service Account

  1. In the navigation menu, go to IAM & Admin → Service Accounts.
  2. Click Create Service Account.
  3. Enter a name and description.
  4. Click Create and Continue.
  5. Skip the optional Grant this service account access to project step.
  6. Click Continue and then Done.
  7. Open the service account and copy its numeric Client ID (under Advanced settings). Its required in Step 6.

Step 4: Generate a Service Account Key (JSON)

  1. In the service account list, click on your newly created service account.
  2. Go to the Keys tab.
  3. Click Add Key → Create New Key.
  4. Select JSON format.
  5. Click Create and download the key file securely.
⚠️

If key creation is blocked, continue to Step 5 to adjust organization policies.

Step 5: Allow Key Creation (If Blocked by Org Policy)

  1. Navigate to IAM & Admin → Organization Policies.
  2. Search for Disable service account key creation.
  3. Click the policy, then click Manage Policy.
  4. Select Override parent policy.
  5. Click Add a rule.
  6. Set the rule to Not enforced (turn enforcement OFF).
  7. Click Done and then Set Policy.

Wait a few minutes, then retry Step 4.

Step 6: Add Client ID in Google Admin Console

  1. Go to admin.google.com.
  2. Navigate to Menu > Security > Access and data control > API controls.
  3. Select Manage Domain Wide Delegation, then Add new.
  4. Paste the Client ID copied from Step 3.
  5. Enter the required scopes from the next section.
  6. Click Authorize.

Step 8: Define OAuth Scopes

Paste the following scopes as a comma-separated list:

Mandatory Scopes

https://www.googleapis.com/auth/admin.directory.domain.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.rolemanagement.readonly,
https://www.googleapis.com/auth/admin.directory.user.readonly,
https://www.googleapis.com/auth/admin.directory.user.security,
https://www.googleapis.com/auth/admin.reports.audit.readonly,
https://www.googleapis.com/auth/admin.reports.usage.readonly,
https://www.googleapis.com/auth/apps.licensing,
https://www.googleapis.com/auth/userinfo.email,
https://www.googleapis.com/auth/userinfo.profile

Optional Scopes (Add based on use cases)

https://www.googleapis.com/auth/admin.contact.delegation,
https://www.googleapis.com/auth/admin.datatransfer,
https://www.googleapis.com/auth/admin.directory.device.chromebrowsers,
https://www.googleapis.com/auth/admin.directory.device.chromebrowsers.readonly,
https://www.googleapis.com/auth/admin.directory.device.chromeos,
https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly,
https://www.googleapis.com/auth/admin.directory.device.mobile,
https://www.googleapis.com/auth/admin.directory.device.mobile.action,
https://www.googleapis.com/auth/admin.directory.domain,
https://www.googleapis.com/auth/admin.directory.group,
https://www.googleapis.com/auth/admin.directory.group.member,
https://www.googleapis.com/auth/admin.directory.orgunit,
https://www.googleapis.com/auth/admin.directory.rolemanagement,
https://www.googleapis.com/auth/admin.directory.user,
https://www.googleapis.com/auth/admin.directory.user.alias,
https://www.googleapis.com/auth/apps.order,
https://www.googleapis.com/auth/apps.order.readonly,
https://www.googleapis.com/auth/calendar,
https://www.googleapis.com/auth/contacts,
https://www.googleapis.com/auth/contacts.other.readonly,
https://www.googleapis.com/auth/gmail.settings.basic

Step 9: Connect the Integration in Zluri

  1. Log in to Zluri Admin Console
  2. Go to Sources → Integrations → Browse Catalog.
  3. Search for Google Workspace (M2M).
  4. Click Connect Integration (or Raise Request, if restricted).
  5. Open the JSON key file from Step 4. Paste the value of private_key into the Private Key field, without the surrounding quotes and without leading or trailing spaces.
  6. Enter the Service Account email and domain.
  7. Click Connect.

Step 10: Verify the Connection

  • Wait for the connection to complete.
  • If successful, Zluri will begin syncing data.

If the connection fails:

  • Double-check the scopes in the Admin Console
  • Make sure the client ID matches the service account
  • Ensure the JSON key is valid and uploaded correctly
  • Confirm that Admin SDK is enabled in GCP
  • Contact Zluri Support if needed

Once connected, Zluri will automatically pull user, group, org unit, and license data from your Google Workspace environment.

For further assistance, please feel free to submit a ticket or contact us directly at [email protected].


Did this page help you?