---
title: Create a ServiceNow connection
description: Learn how to create a ServiceNow connection in Catalog Explorer that stores authentication details for Lakeflow Connect ingestion.
canonical_url: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-connection
---

# Create a ServiceNow connection

Create a ServiceNow connection in Catalog Explorer to store authentication credentials for Lakeflow Connect ingestion. Any user with the `USE CONNECTION` privilege on the connection can then create ServiceNow ingestion pipelines without needing direct access to the credentials.

Alternatively, admin users can create a connection and a pipeline at the same time in the data ingestion UI. See [Create an ingestion pipeline](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-pipeline.md).

For privilege requirements, see [Connect to managed ingestion sources](https://docs.databricks.com/aws/en/connect/managed-ingestion.md).

The following authentication methods are supported:

* User-to-machine (U2M) OAuth (recommended)
* Machine-to-machine (M2M) OAuth (client credentials)
* OAuth Resource Owner Password Credentials (ROPC)

## Prerequisites

Complete the [source setup](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-source-setup.md). Use the authentication details you obtain to create the connection.

## Create a connection

### U2M OAuth

1. In the Databricks workspace, click **Catalog > External locations > Connections > Create connection**.

2. On the **Connection basics** page of the **Set up connection** wizard, specify a unique **Connection name**.

3. In the **Connection type** drop-down menu, select **ServiceNow**.

4. In the **Auth type** drop-down menu, select **OAuth User to Machine**.

5. (Optional) Add a comment.

6. Click **Next**.

7. On the **Authentication** page, enter the following:
   * **Instance URL**: ServiceNow instance URL.
   * **OAuth scope**: Leave the default value `useraccount`.
   * **Client secret**: The client secret that you obtained in the source setup.
   * **Client ID**: The client ID that you obtained in the source setup.

8. Click **Sign in with ServiceNow**.

9. Sign in using your ServiceNow credentials.

   To ingest data using a service account instead of a personal account, sign in with your personal credentials first. On the ServiceNow authorization page that follows, click **Not you?** and then sign in with the service account credentials. You're then redirected to the Databricks workspace.

   If you sign in with a personal account, the pipeline runs under that user's permissions.

10. Click **Create connection**.

### M2M OAuth

1. Complete the [M2M source setup](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-source-setup.md): enable the client credentials grant, and then create an OAuth application with an **OAuth Application User**.

2. In the Databricks workspace, click **Catalog > External locations > Connections > Create connection**.

3. On the **Connection basics** page of the **Set up connection** wizard, specify a unique **Connection name**.

4. In the **Connection type** drop-down menu, select **ServiceNow**.

5. In the **Auth type** drop-down menu, select **OAuth Machine to Machine**.

   ![DB connection basics page with OAuth Machine to Machine selected](https://docs.databricks.com/aws/en/images/lakeflow-connect/servicenow-m2m-connection-basics.png)

6. (Optional) Add a comment.

7. Click **Next**.

8. On the **Authentication** page, enter the following:

   * **Client ID**: The client ID that you obtained in the source setup.
   * **Client secret**: The client secret that you obtained in the source setup.
   * **Instance url**: ServiceNow instance URL without the protocol, in the format `<instance-id>.service-now.com`. For example, if your instance URL is `https://abc.service-now.com`, enter `abc.service-now.com`. To find the instance ID, see [Obtain the instance ID](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-source-setup.md#obtain-instance-id).
   * **OAuth scope**: Leave the default value `useraccount`.

   ![DB authentication page for a ServiceNow M2M connection](https://docs.databricks.com/aws/en/images/lakeflow-connect/servicenow-m2m-authentication.png)

9. Click **Save and test**.

   Databricks requests an access token from ServiceNow using the client credentials. No browser sign-in is required. The pipeline runs with the permissions of the OAuth Application User.

### ROPC

1. In the Databricks workspace, click **Catalog > External locations > Connections > Create connection**.
2. On the **Connection basics** page of the **Set up connection** wizard, specify a unique **Connection name**.
3. In the **Connection type** drop-down menu, select **ServiceNow**.
4. In the **Auth type** drop-down menu, select **OAuth Resource Owner Password**.
5. (Optional) Add a comment.
6. Click **Next**.
7. On the **Authentication** page, enter the following:
   * **User**: Your ServiceNow username.
   * **Password**: Your ServiceNow password.
   * **Instance URL**: ServiceNow instance URL.
   * **Client ID**: The client ID that you obtained in the source setup.
   * **Client secret**: The client secret that you obtained in the source setup.
8. Click **Create connection**.

## Next steps

[Create an ingestion pipeline](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/servicenow-pipeline.md).
