- Automatic synchronization runs every 30 minutes after the last sync completes.
- Manual synchronization runs when you trigger it.
Enable Directory Sync
You can enable Directory Sync using the Auth0 Dashboard or the Management API.- Auth0 Dashboard
- Management API
1
Prerequisites
Before you begin, you must have:
- A Google Workspace enterprise connection in Auth0
- Administrator privileges on the Google Workspace organization.
2
Enable the admin directory API for your enterprise connection
To enable directory sync, the Google access token for your Google Workspace enterprise connection must have the the appropriate scopes to access Google’s APIs.On the Settings tab of an existing Google Workspace enterprise connection (or when creating new connection), in the Identity Provider API section, select Use Admin Directory API and choose:
- Users scopes to add scopes only to access users.
- Users and Groups scopes to add scopes to access both users and groups.
3
Verify Google administrator consent
From Auth0 Dashboard > Authentication > Enterprise, open your Google Workspace connection. On the Setup tab, either:
- Follow the Continue link if you have admin permissions to configure your Google Workspace settings to use Google’s Admin APIs, or
- Provide the given URL to your administrator so that they can adjust the required settings
4
Enable Directory Sync
On the Provisioning tab of your connection, toggle Provision Users Using Directory Sync. and choose the your configuration options:
- In Resources, under Sync. choose whether to sync Users or Users and Groups. If you sync both users and groups, the section expands to show which groups are syncing (Syncing all groups by default). To customize the synced groups, see the next step.
- In Schedule, optionally check Enable Automatic Synchronization to automatically sync every 30 minutes. You can trigger a manual synchronization by selecting Synchronize now.
- In Attribute Mapping, you can customize the mapping of Google attributes to Auth0 user profile attributes.
5
Customize synced groups (optional)
When you enable Directory Sync to synchronize both users and groups from Google Workspace, you can choose to sync all groups in your directory or choose only a subset to prevent database bloat and preserve API rate limits.You can customize which groups you synchronize by either selecting them from the paginated list in the Auth0 Dashboard or by uploading a JSON of the group IDs:The Resources section displays Syncing specific groups. To update which groups you synchronize, return to the same Select Groups window and update your choices.If we detect that a synchronized group ID is deleted in Google Workspace Directory, we automatically remove that group ID from the configuration for subsequent job syncs.
- Select from list
- Upload JSON
- On the Provisioning tab of your connection, under the toggled Provision Users Using Directory Sync option, find the Resources section and select the Select Groups… button.
- In the Select Groups window that opens, select the Select tab to view the list of available groups. This information is synced live with your Google Workspace groups. You can use the search bar to filter against group name or email.
- Check the boxes next to the groups you want to sync, then select Save Groups at the bottom of the window.
Monitor Directory Sync activity
You can monitor sync activity in Auth0 tenant logs the under Directory Sync Started and Directory Sync Completed log types (event codesdirectory_sync_started and directory_sync_completed).
Limits
- Synchronizing manually within 30 minutes of the last completed sync returns a 400 error. Wait at least 30 minutes before synchronizing again.
- When using user account linking, the sync-provisioned user account must be set as the primary user account. We do not recommend linking Enterprise user accounts to social and personal user accounts.
- Group names in Google Workspace Directory must be unique. While Google allows case-insensitive duplicate names, Auth0 enforces unique display names. If you have multiple groups with the same name in Google Workspace Directory, the duplicate groups do not sync and the sync is marked as failed.
- Because Google only reports users as deleted within 20 days of deletion, if you delete a user in Google Workspace Directory and do not sync with Auth0 within 20 days, we do not detect that the user has been deletected. We recommend automatic synchronization to avoid this issue.