# Google Workspace Directory Sync

Directory Sync now supports Google Workspace. Clerk connects directly to your Workspace directory and syncs [users](https://clerk.com/docs/guides/configure/auth-strategies/enterprise-connections/directory-sync.md#view-directory-users), [groups, and group memberships](https://clerk.com/docs/guides/configure/auth-strategies/enterprise-connections/directory-sync.md#role-mapping).

Clerk pulls the directory with a Google service account and computes changes, keeping your user base current without waiting for sign-in events.

## Set up

Open a Google SAML connection in the [Clerk Dashboard](https://dashboard.clerk.com/~/user-authentication/sso-connections) and select the **Directory sync** tab.

Upload a service account key with domain-wide delegation, along with the Workspace admin it should impersonate. Clerk validates the credentials against your directory before enabling Directory Sync.

If you disable it later, Clerk keeps the stored credentials so you can re-enable it with one click.

## Works with role mapping and custom attributes

Google groups sync automatically and can be mapped to Clerk Roles.

Custom attribute mapping supports the full pulled directory record, including standard fields such as `organizations.title` and Workspace custom schemas such as `customSchemas.EmployeeInfo.costCenter`.

Map array paths to a multi-valued attribute to sync all items.

See the [Directory Sync docs](https://clerk.com/docs/guides/configure/auth-strategies/enterprise-connections/directory-sync.md) for the full setup guide.
