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

# SAP Gateway

export const title_4 = "SAP Gateway";

export const title_3 = "SAP Gateway";

export const title_2 = "SAP Gateway";

export const title_1 = "SAP Gateway";

export const title_0 = "SAP Gateway";

## Setup Guide

Follow these steps to connect SAP Gateway to your Connect AI account:

<Steps>
  <Step>
    Open the **Sources** page of the Connect AI navigation menu.
  </Step>

  <Step>
    Click **+ Add Connection** in the upper-right corner.
  </Step>

  <Step>
    Type *SAP Gateway* into the search field, then click the data source name.
  </Step>

  <Step>
    On the **Basic Settings** tab of the new connection, enter a connection name or keep the default name.
  </Step>

  <Step>
    Enter the **URL** for your SAP Gateway environment or the full URL of the OData service. Any additional properties must be added using **Custom URL Params**.
  </Step>

  <Step>
    (Optional) Enter the service **Namespace** you want to retrieve data from. This is only required if the service is not specified in the **URL**.
  </Step>

  <Step>
    (Optional) Enter the **Service**, which is a comma-delimited list of services you want to retrieve data from. If the service is set in the **URL**, this property is ignored. In cases where the service is not set in the URL or in **Service**, the SAP Gateway's catalog service is used to discover all available services.
  </Step>

  <Step>
    (Optional) Enter any **Custom URL Params** to be included with the HTTP request. The parameters should be in the form *field1=value1\&field2=value2\&field3=value3*.
  </Step>

  <Step>
    Select an **AuthScheme** and follow the relevant instructions below.
  </Step>
</Steps>

## Authentication Methods

<Tabs>
  <Tab title="Basic">
    <Steps>
      <Step>
        Enter the **User** Id for the authenticating user.
      </Step>

      <Step>
        Enter the **Password** for the authenticating user.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_0} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>

  <Tab title="OAuth">
    <Steps>
      <Step>
        Enter the **OAuth Client Id** assigned to your custom OAuth application. This Id is required to identify the application to the OAuth authorization server during authentication.
      </Step>

      <Step>
        Enter the **OAuth Client Secret** assigned to your custom OAuth application. This value is used to authenticate the custom application to the OAuth authorization server.
      </Step>

      <Step>
        Enter the **Scope**, or permission scopes, in space separated values. Scopes define what kind of access the authenticating user has, such as read or read/write. Scopes are required for OAuth 2.0.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_1} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Token">
    <Steps>
      <Step>
        Enter the **API Key** of the application you have created.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_2} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>

  <Tab title="OAuthPKCE">
    <Steps>
      <Step>
        Set authentication to **OAuthPKCE** to use the Proof Key of Code Exchange (PKCE) extension of the standard OAuth2 flow. Set your own PKCEVerifier or let the driver automatically generate one for you.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_3} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>

  <Tab title="SAPBTP">
    <Steps>
      <Step>
        In **Advanced Settings**, enter the **Destination URL** of the SAP BTP destination source. This URL is found in the service key of your Destination Service instance in the SAP BTP Cockpit, in the **URI** field.
      </Step>

      <Step>
        In **Advanced Settings**, enter the **Destination Name** of the SAP BTP destination to retrieve the authentication details from.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_4} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Connect Gateway Connection

SAP Gateway is a supported connector with Connect Gateway, which acts as a bridge between your on-premises data and Connect AI. See [Connect Gateway](/en/Connect-Gateway) for more information. Once you set up the gateway, you can select the **Connection Type** of **Connect Gateway**. Then enter **Location Name** of the gateway and the SAP Gateway authentication information.

## More Information

For more information about interactions between Connect AI and SAP Gateway, see [this information page](https://cdn.cdata.com/help/GCM/cloud/default.htm#default).
