> For the complete documentation index, see [llms.txt](https://help.nightfall.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.nightfall.ai/nightfall_settings/directory_sync/google_workspace.md).

# Google Workspace Directory Service

Learn how to sync your Google Workspace data to Nightfall.

This document explains the process of adding your Google Workspace tenant to Nightfall to enable Directory Sync. Once you add Google Workspace to Nightfall, you can sync users and user groups data from Google Workspace to Nightfall. To get an overview of the Directory Sync feature in Nightfall, you can read [this article](/nightfall_settings/directory_sync.md) and then proceed with this document.

{% hint style="info" %}
You need a Google Workspace **Super Admin** account. Directory Sync uses its own service account and domain-wide delegation entry, separate from Google Drive. Its access is read only. For the scopes shown in step 5 and why each is needed, see [SaaS App Permissions Reference](/nightfall_integrations/saas-app-permissions-reference.md).
{% endhint %}

To install Google Directory:

1. Click the **Settings** button in Nightfall.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2Fxgq9gt7LXyMw4j9JfibI%2Fimage.png?alt=media&amp;token=528c5b03-6e73-495d-807c-49e052aa24ea" alt=""><figcaption></figcaption></figure>

2. Click the **Directory Sync** tab.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FKFrumwvRDMR9Y3eQ5WAM%2Fimage.png?alt=media&amp;token=6bae4f83-8289-4be0-ba0a-c7fd036c95a7" alt=""><figcaption></figcaption></figure>

3. Click **Add directory**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2Fa1xNvce4yNVFvcxfTSyt%2Fimage.png?alt=media&amp;token=044f7ee6-4ea6-4120-9bcb-eb4a7475159b" alt=""><figcaption></figcaption></figure>

4. Select **Google Workspace** as the identity provider.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FAQY1GjH0k5lFNHTxJg82%2Fimage.png?alt=media&amp;token=4c4ef31b-196d-4eb0-aaa4-df5a1f85ed18" alt=""><figcaption></figcaption></figure>

5. Copy the **Client ID** and **OAuth Scope ID**. Store these values in a secure place. You require them in the further steps.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2Fvw2FxtkpN6rWiBfT0FXW%2Fimageedit_19_8537558229.jpg?alt=media&amp;token=911bc2f4-c8d9-4d02-968a-18e27d66111a" alt=""><figcaption></figcaption></figure>

6. Login to your Google Workspace with a Super Admin account.
7. Click the menu icon.
8. Select **Admin**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2F9FWwTibs80Qo22vARFpO%2Fimage.png?alt=media&amp;token=69092f0c-b446-4d35-98fe-8f8778fbaa83" alt=""><figcaption></figcaption></figure>

9. In the Admin console left pane, expand **Security** and then expand **Access and data control**.
10. Click **API controls**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FN8w0ld2iiuTXEuT19XAU%2Fimage.png?alt=media&amp;token=38492208-f946-469f-b49d-49515b60e3a6" alt=""><figcaption></figcaption></figure>

11. Click **MANAGE DOMAIN WIDE DELEGATION** under **Domain wide delegation**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2Fg8TYvO0PVzez7IDD45rn%2Fimage.png?alt=media&amp;token=20b30913-c212-449c-a226-e5a3c7404003" alt=""><figcaption></figcaption></figure>

12. Click **Add New**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FwpiwjYQ3GaYdtzhoR4YV%2Fimage.png?alt=media&amp;token=ad6d0066-b6b9-4ca7-a399-bc5b7e070424" alt=""><figcaption></figcaption></figure>

13. Paste the **Client ID** copied from the Nightfall app, in the **Client ID** field.
14. Paste the **Scopes ID** copied from the Nightfall app, under **OAuth Scope** fiel&#x64;**.** Use comma to add multiple scope IDs.
15. Click **AUTHORIZE.**

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FwXRBxVCQFUkoN5KUYCzJ%2Fimage.png?alt=media&amp;token=5a1dafcb-ef17-4f3c-afe9-9d0725f50db3" alt=""><figcaption></figcaption></figure>

16. Return to the Nightfall app and click **Continue**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2F8SISQ9V8mnDBOafKjUD1%2Fimageedit_19_4340614910.jpg?alt=media&amp;token=fca692c9-f8e9-4928-a43e-bfd00b463e86" alt=""><figcaption></figcaption></figure>

17. Click **Connect**.

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FE2N8q0arTgd9rvH4wTt0%2Fimage.png?alt=media&amp;token=6df87245-d8e9-401d-8362-7e555b37833d" alt=""><figcaption></figcaption></figure>

Once the setup is completed, Nightfall displays the list of active and inactive users in your Google Workspace. Nightfall syncs with your Identity and Access Provider every four hours. Also, you can manually sync once every hour. To sync data manually, click the ellipsis menu and select **Refresh.**

<figure><img src="https://2214688951-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg3wgFIu8T7XAT1u-f_%2Fuploads%2FuCBGniHhIt2LOf8XKIH8%2Fimage.png?alt=media&amp;token=fbf00f72-ca9d-42be-bbaa-42925e73eeee" alt=""><figcaption></figcaption></figure>

Currently, once registered you cannot unregister an Identity and Access Provider from Nightfall. If you wish to unregister your Identity and Access Provider, please contact Nightfall support.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.nightfall.ai/nightfall_settings/directory_sync/google_workspace.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
