---
title: Connect Google Workspace to Directory Sync
description: Authorize Directory Sync in the Google Admin console, add a Google CDS domain, and set up the sync of users and groups into OpenLM Version 26.
product: OpenLM Version 26 (legacy)
---

> **OpenLM Version 26 (legacy).** This page documents the legacy product, not OpenLM Platform.

To bring the users, groups, and organizational units (OUs) of a Google Workspace directory into OpenLM, connect the directory to Directory Sync. In the Directory Sync UI, this directory type is **Google CDS**.

Directory Sync connects with a Google service account that OpenLM provides. You authorize that account in your Google Admin console with read-only access, and then add the domain and the sync in Directory Sync.

## Before you begin

Confirm these prerequisites:

- A super administrator account for your Google Workspace domain. Google requires it for the authorization step.
- The Directory Synchronization Service (DSS) connected to OpenLM SLM, and at least one approved Directory Synchronization Agent (DSA). See [Directory Sync v2x configuration](https://www.openlm.com/documentation/legacy/directory-sync/configuration).

## Authorize Directory Sync in Google Workspace

To let Directory Sync read your directory:

1. Sign in to the Google Admin console as a super administrator.
2. Select **Security**, then **Access and data control**, then **API controls**, and then select **Manage Domain Wide Delegation**.
3. Select **Add new**.
4. In **Client ID**, enter `117731328853281683659`.
5. In **OAuth scopes**, enter this comma-separated list of scopes:

   ```text
   https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/admin.directory.orgunit.readonly,https://www.googleapis.com/auth/admin.directory.group.readonly,https://www.googleapis.com/auth/admin.directory.group.member.readonly,https://www.googleapis.com/auth/admin.directory.user.readonly
   ```

6. Select **Authorize**.

The five scopes cover your domains, organizational units, groups, group members, and users. All of them are read-only: Directory Sync can view your directory and can't change it.

For Google's own description of this screen, see [Control API access with domain-wide delegation](https://support.google.com/a/answer/162106).

## Add the Google CDS domain

To add the directory as a domain:

1. In the Directory Sync UI, open **Domain Manager**, and then select **Add Domain**.
2. In **Directory type**, select **Google CDS**.
3. Fill in the fields:

   - **Domain name**: Your Google Workspace domain, for example `example.com`.
   - **Client Id**: The client ID that you authorized in the Google Admin console.
   - **Username**: The email address of the Google Workspace administrator account that Directory Sync connects with.

4. Select **Check domain connectivity**, and then select the agent that runs the test. The test takes up to 2 minutes.
5. Select **Save**. To go straight to a new sync definition for this domain, select **Save Domain & Add Sync** instead.

## Set up the sync

To sync the domain, add a sync definition as described in [Add a new sync definition](https://www.openlm.com/documentation/legacy/directory-sync/configuration#add-a-new-sync-definition). For a Google CDS domain, these settings differ from the ones for an LDAP directory:

| Setting | What to enter for Google CDS |
| --- | --- |
| **Start Sync From** | Leave it empty to sync all OUs, groups, and users. To start from one OU, enter `ou=<ou_name>`. To start from one group, enter `group=<group_name>`, for example `group=engineering@example.com`. You can enter one OU or one group. |
| **Sync object type** | **Users**. Google CDS domains don't sync computers. |
| **Sync attribute** | `email`. |
| **Membership filter** | **All objects**, **Only members of OUs**, or **Only members of Security Groups**. |
| **Search depth** | 0, unless you set an OU or a group in **Start Sync From**. |
| **Hierarchical** group rule | Directory Sync creates the groups from **Security groups** and **OU**. Distribution groups and customized object classes aren't available. |

To change which Google attribute fills each OpenLM user property, see [Directory attribute mappings in Directory Sync](https://www.openlm.com/documentation/legacy/directory-sync/attribute-mappings).
