> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ServiceNow Setup

> Connect your ServiceNow environment to Genow.

This article provides a technical walkthrough for IT administrators to connect a **ServiceNow Knowledge Base** to the **Genow** platform for secure knowledge retrieval. The integration utilizes **OAuth 2.0 Client Credentials** to allow Genow to securely index content while respecting your instance's native security and access controls.

<Steps>
  <Step title="Enable OAuth Client Credential Grants">
    To support machine-to-machine authentication, you must ensure the ServiceNow instance allows the Client Credential grant type.

    1. Open the **All menu** and enter `sys_properties.list` into the filter navigator.
    2. Locate the following property in the **Name** column:
       `glide.oauth.inbound.client.credential.grant_type.enabled`
    3. **If the record exists:** Open the record and verify the **Value** is set to **true**. Click **Update** to save any changes.
    4. **If the record does not exist:** Click **New** and configure the property with the following details:
       * **Name:** `glide.oauth.inbound.client.credential.grant_type.enabled`
       * **Type:** `true | false`
       * **Value:** `true`
       * Click **Submit**
  </Step>

  <Step title="Configure the Machine User">
    1. Navigate to **User Administration > Users**.
    2. Click **New** to create a service account.
    3. Assign a **User ID** (e.g., `genow_sync_user`).
    4. Set the **Identity Type** to **Machine**.
    5. Enable the **Internal Integration User** checkbox.
    6. Click **Submit**.
    7. Locate and re-open the `genow_sync_user` record from the list.
    8. Navigate to the **Roles** related list at the bottom and click **Edit**
    9. Assign the following **mandatory roles**:
       * `knowledge`: Grants essential read access to the Knowledge Management Application.
       * `snc_platform_rest_api_access`: Permits the account to interact with ServiceNow’s inbound REST APIs.
    10. Move the roles to the right-hand column and click **Save**.
  </Step>

  <Step title="Knowledge Base Security (User Criteria)">
    Genow adheres to your existing security configurations. If you intend to sync restricted Knowledge Bases, the machine user must be granted explicit read permissions.

    1. Navigate to **Knowledge > Administration > Knowledge Bases**.
    2. Open the specific **Knowledge Base** targeted for synchronization.
    3. Scroll to the **Can Read** related list at the bottom of the page.
    4. If your instance defaults to hidden or restricted access, click **New** (or edit existing criteria) to add your `genow_sync_user` to the list. This ensures the integration has the necessary read access to index the content.
  </Step>

  <Step title="Register the OAuth Application">
    1. Navigate to **System OAuth > Application Registry**.
    2. Click **New** and select the option: **Create an OAuth API endpoint for external clients**.
    3. Provide a **Name** for the registration (e.g., `Genow Sync`).
    4. Set the **Client Type** to **Integration as a Service**.
    5. To expose mandatory fields, **right-click the grey header**, select **Configure > Form Design**, and drag the **Default Grant Type** and **OAuth Application User** fields onto the form. Save your form changes.
    6. Refresh the **Application Registry** page in your browser.
    7. Set the **Default Grant Type** to **Client Credentials**.
    8. Set the **OAuth Application User** to the `genow_sync_user` created in Phase 2.
    9. **Leave the following fields blank:** Client Secret, Redirect URL, and Login URL.
    10. Locate the **Scope Restriction** field on the right side and change it from `Securely scoped` to **Broadly scoped**. This is necessary to allow the token to access global tables, such as the knowledge base.
    11. Click **Submit** (or right-click the header and click **Save** to remain on the record).
  </Step>

  <Step title="Credential Retrieval and Finalization">
    Retrieve the auto-generated keys to finalize the connection within the Genow Platform.

    1. Open the **Genow Sync** record you created in the Application Registry.
    2. Copy the **Client ID** string.
    3. Click the **padlock icon** next to the **Client Secret** field to reveal the auto-generated password and copy it.
    4. Input the **Client ID** and **Client Secret** into the Genow Platform to create a "Credential" object.
  </Step>
</Steps>

<Info>
  **Security Note:** The **Client Secret** is treated as sensitive data and is encrypted and stored securely within the **Google Cloud Secret Manager**.
</Info>
