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

# REST

export const CommonAuthSchemeOauthPassword = ({datasource = "the data source"}) => {
  return <>
      <p>To connect with your user credentials, specify the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>OAuthPassword</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your {datasource} account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your {datasource} account.</li>
        <li><strong>OAuth Client Id:</strong> Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.</li>
        <li><strong>OAuth Client Secret:</strong> Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.</li>
      </ul>
    </>;
};

export const CommonAuthSchemeOauthJwt = ({datasource = "the data source"}) => {
  return <>
      <p>To connect with a {datasource} account, specify the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>OAuthJWT</strong>.</li>
        <li><strong>OAuth Client Id:</strong> Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.</li>
        <li><strong>OAuth Client Secret:</strong> Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.</li>
        <li><strong>Scope:</strong> Enter the scope of your access to the application.</li>
        <li><strong>OAuth JWT Cert:</strong> Enter your Java web tokens (JWT) certificate store.</li>
        <li><strong>OAuth JWT Cert Type:</strong> Enter the type of key store that contains your JWT certificate. The default type is <strong>PEMKEY_BLOB</strong>.</li>
        <li><strong>OAuth JWT Issuer:</strong> Enter the issuer of your Java web token. Typically, the issuer is either the client Id or the email address of the OAuth application.</li>
        <li>(Optional) <strong>OAuth JWT Cert Subject:</strong> Enter the subject of your OAuth JWT certificate.</li>
        <li>(Optional) <strong>OAuth JWT Subject:</strong> Enter the user subject for which the application is requesting delegated access.</li>
        <li>(Optional) <strong>OAuth JWT Subject Type:</strong> Select the subject type (<strong>enterprise</strong> or <strong>user</strong>) for the JWT authentication. The default type is <strong>enterprise</strong>.</li>
        <li>(Optional) <strong>OAuth JWT Public Key Id:</strong> Enter the Id of the public key for JWT.</li>
      </ul>
    </>;
};

export const CommonAuthSchemeGcpinstanceaccount = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>
        When you run {siteName} on a GCP virtual machine, {siteNameShort} can authenticate by using the service account that is tied to the virtual machine. Select <strong>GCPInstanceAccount</strong> for <strong>Auth Scheme</strong> to use that account. No additional properties are required.
      </p>
    </>;
};

export const CommonAuthSchemeDigest = ({datasource = "the data source"}) => {
  return <>
      <p>To connect with your user credentials, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>Digest</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your {datasource} account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your {datasource} account.</li>
      </ul>
    </>;
};

export const CommonAuthSchemeBasic = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect with your user credentials, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>Basic</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your {datasource} account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your {datasource} account.</li>
      </ul>
    </>;
};

export const CommonAuthSchemeSas = () => {
  return <>
      <p>To connect with an Azure shared access signature, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>SAS</strong>.</li>
        <li><strong>Azure Shared Access Signature:</strong> Enter the shared access signature that is associated with the storage account.</li>
      </ul>
      <p>To create an Azure shared access signature:</p>
      <ol>
        <li>Sign in to the <a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure portal</a> with the credentials for your root account.</li>
        <li>Click <strong>Storage accounts</strong> and select the storage account you want to use.</li>
        <li>Under <strong>Settings</strong>, click <strong>Shared Access Signature</strong>.</li>
        <li>Set the permissions and a date when the token will expire.</li>
        <li>Click <strong>Generate SAS</strong> and copy the token that is generated.</li>
      </ol>
    </>;
};

export const CommonAuthSchemeAzuremsi = ({siteName = "CData Sync"}) => {
  return <>
      <p>
        To leverage Azure Managed Service Identity (MSI) when {siteName} is running on an Azure
        virtual machine, select <strong>Azure MSI</strong> for <strong>Auth Scheme</strong>. No
        additional properties are required.
      </p>
    </>;
};

export const CommonAuthSchemeAccesskey = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect with an Azure access key, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>Access Key</strong>.</li>
        <li><strong>Azure Access Key:</strong> Enter the access key that is associated with your storage account.</li>
      </ul>
      <p>To retrieve your access key:</p>
      <ol>
        <li>Sign in to the <a href="https://portal.azure.com/" target="_blank" rel="noopener noreferrer">Azure portal</a> with the credentials for your root account.</li>
        <li>Click <strong>Storage accounts</strong> and select the storage account that you want to use.</li>
        <li>Under <strong>Settings</strong>, click <strong>Access keys</strong>. Your storage account name and key are displayed on that page.</li>
      </ol>
    </>;
};

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        For more information about interactions between {siteName} and {datasource}, see{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/synch/default.htm`}>
          {datasource} Connector for {siteName}
        </a>.
      </p>
    </>;
};

export const CommonDatasourceAddConnector = ({datasource = "the data source", title = "the connector", destination = false, siteNameShort = "Sync"}) => {
  return <>
      <p>
        To enable {siteNameShort} to use data from {datasource}, you first must add the
        connector, as follows:
      </p>
      <ol>
        <li>Open the <strong>Connections</strong> page of the {siteNameShort} dashboard.</li>
        <li>Click <strong>Add Connection</strong> to open the <strong>Select Connectors</strong> page.</li>
        <li>
          Click the <strong>{destination ? "Destinations" : "Sources"}</strong> tab and locate
          the <strong>{title}</strong> row.
        </li>
        <li>
          Click the <strong>Configure Connection</strong> icon at the end of that row to open
          the <strong>New Connection</strong> page. This action opens the{' '}
          <strong>Add Connection</strong> dialog box.
          <br />
          <strong>Note:</strong> If the <strong>Configure Connection</strong> icon is not
          available, click the <strong>Download Connector</strong> icon to install
          the {title} connector.
        </li>
        <li>Enter a name for your connection in the <strong>Add Connection</strong> dialog box.</li>
        <li>Click <strong>Add</strong> to open the <strong>Settings</strong> tab for your connector.</li>
      </ol>
      <p>
        For more information about installing new connectors, see{' '}
        <a href="../connections">Connections</a>.
      </p>
    </>;
};

export const CommonDatasourceIntroSource = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      You can use the {datasource} connector from the {siteName} application to capture data
      from {datasource} and move it to any supported destination. To do so, you need to add
      the connector, authenticate to the connector, and complete your connection.
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

export const datasource = "REST";
export const pageTitle = "REST";
export const advancedurl = "DW";
export const oauthschemes = "AzureAD";

<CommonDatasourceIntroSource datasource={datasource} siteName={siteName} />

## Add the REST Connector

<CommonDatasourceAddConnector datasource={datasource} title={pageTitle} destination={false} siteNameShort={siteNameShort} />

## Authenticate to REST

After you add the connector, you need to set the required properties.

* **Api Key:** Enter the API key that identifies the user to IBM Cloud.
* **URI:** Enter the Uniform Resource Identifier (URI) for your resource location.
* **Region:** Enter the hosting region for your S3-like web services.
* **Oracle Namespace:** Enter the Oracle Cloud Object Storage namespace to use.
* **Azure Storage Account:** Enter the name of your Azure storage account.

{siteName} supports authenticating to {pageTitle} in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**Access Key**](#azure-access-key)
* [**AWS Credentials File**](#aws-credentials-file)
* [**Azure Active Directory**](#azure-active-directory)
* [**Azure Managed Service Identity**](#azure-managed-service-identity)
* [**Azure Service Principal**](#azure-service-principal)
* [**Azure Service Principal Certificate**](#azure-service-principal-certificate)
* [**Azure Shared Access Signature**](#azure-shared-access-signature)
* [**Basic**](#basic) (default)
* [**Digest**](#digest)
* [**GCP Instance Account**](#gcp-instance-account)
* [**IAM Secret Key**](#iam-secret-key)
* [**Negotiate**](#negotiate)
* [**None**](#none)
* [**OAuth**](#oauth)
* [**OAuth Client**](#oauth-client)
* [**OAuth JWT**](#oauth-jwt)
* [**OAuth Password**](#oauth-password)
* [**OAuth PKCE**](#oauth-pkce)
* [**Secure File Transfer Protocol**](#secure-file-transfer-protocol)

### Azure Access Key

<CommonAuthSchemeAccesskey siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### AWS Credentials File

To connect with a credentials file, specify the following properties:

* **Auth Scheme:** Select **AwsCredentialsFile**.
* **AWS Credentials File:** Enter the location of your Amazon Web Services (AWS) credentials file.
* (Optional) **AWS Credentials File Profile:** Enter the name of the AWS profile that you want to use from the credentials file that you specify. If you do not enter a profile name, {siteNameShort} uses the profile named default.

### Azure Active Directory

To connect with an Azure Active Directory (AD) user account, specify the following properties:

* **Auth Scheme:** Select **AzureAD**.
* **Use Lake Formation:** Select the **Enable** checkbox if you want the AWS Lake Formation service to retrieve temporary credentials. These temporary credentials enforce access policies against the user based on the configured IAM role. You can use this service when you authenticate through AzureAD, Okta, ADFS, and PingFederate, while providing a Security Assertion Markup Language (SAML) assertion. By default, the **Enable** checkbox is not selected.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* **OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.

### Azure Managed Service Identity

<CommonAuthSchemeAzuremsi siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Azure Service Principal

To connect with an Azure service principal and client secret, set the following properties:

* **Auth Scheme:** Select **AzureServicePrincipal**.
* **Azure Tenant:** Enter the Microsoft Online tenant to which you want to connect.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* **OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.
* (Optional) **Scope:** Specify the scope of your access to the application.
* (Optional) **OAuth Authorization URL:** Enter the OAuth authorization URL for the OAuth service.
* (Optional) **OAuth Access Token URL:** Enter the URL from which to retrieve the access token.
* (Optional) **OAuth Refresh Token URL:** Enter the URL from which to refresh the OAuth token.

To obtain the OAuth client Id and client secret for your application:

1. Log in to the <a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure portal</a>.
2. In the left navigation pane, select **All services**. Then, search for and select **App registrations**.
3. Click **New registrations**.
4. Enter an application name and select **Any Azure AD Directory - Multi Tenant**.
5. After you create the application, copy the application (client) Id value that is displayed in the **Overview** section. Use this value as the OAuth client Id.
6. Navigate to the **Certificates & Secrets** section and select **New Client Secret** for the application.
7. Specify the duration and save the client secret. After you save it, the key value is displayed.
8. Copy this value because it is displayed only once. You will use this value as the OAuth client secret.
9. On the **Authentication** tab, make sure to select **Access tokens (used for implicit flows)**.

### Azure Service Principal Certificate

To connect with an Azure service principal and client certificate, set the following properties:

* **Auth Scheme:** Select **AzureServicePrincipalCert**.
* **Azure Tenant:** Enter the Microsoft Online tenant to which you want to connect.
* **OAuth JWT Cert:** Enter your Java web tokens (JWT) certificate store.
* **OAuth JWT Cert Type:** Enter the type of key store that contains your JWT Certificate. The default type is **PEMKEY\_BLOB**.
* (Optional) **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* (Optional) **Scope:** Specify the scope of your access to the application.
* (Optional) **OAuth Authorization URL:** Enter the OAuth authorization URL for the OAuth service.
* (Optional) **OAuth Access Token URL:** Enter the URL from which to retrieve the access token.
* (Optional) **OAuth Refresh Token URL:** Enter the URL from which to refresh the OAuth token.
* (Optional) **OAuth JWT Cert Password:** Enter the password for your OAuth JWT certificate.
* (Optional) **OAuth JWT Cert Subject:** Enter the subject of your OAuth JWT certificate.

To obtain the OAuth certificate for your application:

1. Log in to the <a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure portal</a>.
2. In the left navigation pane, select **All services**. Then, search for and select **App registrations**.
3. Click **New registrations**.
4. Enter an application name and select **Any Azure AD Directory - Multi Tenant**.
5. After you create the application, copy the application (client) Id value that is displayed in the **Overview** section. Use this value as the OAuth client Id.
6. Navigate to the **Certificates & Secrets** section and select **Upload certificate**. Then, select the certificate to upload from your local machine.
7. Specify the duration and save the client secret. After you save it, the key value is displayed.
8. Copy this value because it is displayed only once. You will use this value as the OAuth client secret.
9. On the **Authentication** tab, make sure to select **Access tokens (used for implicit flows)**.

### Azure Shared Access Signature

<CommonAuthSchemeSas siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Basic

<CommonAuthSchemeBasic siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Digest

<CommonAuthSchemeDigest siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### GCP Instance Account

<CommonAuthSchemeGcpinstanceaccount siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### IAM Secret Key

To connect with an IAM secret key, set the following properties:

* **Auth Scheme:** Select **IAMSecretKey**.
* **Access Key:** Enter your account access key. This value is available from your security credentials page.
* **Secret Key:** Enter your account secret key. This value is available from your security credentials page.

### Negotiate

To connect with Kerberos credentials, specify the following properties:

* **Auth Scheme:** Select **Negotiate**.
* **User:** Enter the username that you use to authenticate to {datasource}.
* **Password:** Enter the password that you use to authenticate to {datasource}.
* **Kerberos KDC:** Enter the Kerberos Key Distribution Center (KDC) service that you use to authenticate.
* **Kerberos Realm:** Enter the Kerberos 5ealm that you use to authenticate.
* **Kerberos SPN:** Enter the service principal name (SPN) for the Kerberos domain controller.
* (Optional) **Kerberos User:** Enter the principal name for the Kerberos Domain Controller. The name should be in the form Host/User\@Realm.
* (Optional) **Kerberos Keytab File:** Enter the path to the keytab file that contains your pairs of the Kerberos principals and encrypted keys.
* (Optional) **Kerberos Service Realm:** Enter the Kerberos realm of the service.
* (Optional) **Kerberos Service KDC:** Enter the Kerberos Key Distribution Center (KDC) service that you use to authenticate.
* (Optional) **Kerberos Ticket Cache:** Enter the full path to an MIT Kerberos credential cache file. Sync uses the specified cache file to obtain the Kerberos ticket that is required to connect to Apache HBase.

### OAuth

To connect with OAuth custom credentials, specify the following properties:

* **Auth Scheme:** Select **OAuth**.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* **OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.
* (Optional) **Scope:** Specify the scope of your access to the application.
* (Optional) **OAuth Authorization URL:** Enter the OAuth authorization URL for the OAuth service.
* (Optional) **OAuth Access Token URL:** Enter the URL from which to retrieve the access token.
* (Optional) **OAuth Refresh Token URL:** Enter the URL from which to refresh the OAuth token.

### OAuth Client

To connect with an OAuth client, specify the following properties:

* **Auth Scheme:** Select **OAuthClient**.
* **OAuth JWT Cert:** Enter your Java web tokens (JWT) certificate store.
* **OAuth JWT Cert Type:** Enter the type of key store that contains your JWT Certificate. The default type is **PEMKEY\_BLOB**.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* **OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.
* (Optional) **Scope:** Enter the scope of your access to the application.
* (Optional) **OAuth Authorization URL:** Enter the OAuth authorization URL for the OAuth service.
* (Optional) **OAuth Access Token URL:** Enter the URL from which to retrieve the access token.
* (Optional) **OAuth Refresh Token URL:** Enter the URL from which to refresh the OAuth token.
* (Optional) **Subject Id:** Enter the user subject for which the application is requesting delegated access.
* **Subject Type:** Select the subject type for the client-credentials authentication. The default type is **enterprise**.

### OAuth JWT

<CommonAuthSchemeOauthJwt siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

* (Optional) **OAuth JWT Audience:** Enter a space-separated list of entities that can use the JWT.
* (Optional) **OAuth JWT Validity Time:** Specify (in seconds) how long the JWT should remain valid. The default number of seconds is **3600**. Click the up and down arrows to specify the number of seconds, or enter the number directly in the text box.

### OAuth Password

<CommonAuthSchemeOauthPassword siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

* **OAuth Version:** Select the OAuth version that you want to use. The default value is the latest version.
* (Optional) **Scope:** Enter the scope of your access to the application.
* (Optional) **OAuth Authorization URL:** Enter the OAuth authorization URL for the OAuth service.
* (Optional) **OAuth Access Token URL:** Enter the URL from which to retrieve the access token.
* (Optional) **OAuth Refresh Token URL:** Enter the URL from which to refresh the OAuth token.

### OAuth PKCE

To connect with the OAuth PKCE extension, set the following properties:

* **Auth Scheme:** Select **OAuthPKCE**.
* (Optional) **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.

### Secure File Transfer Protocol

To connect using Secure File Transfer Protocol, set the following properties:

* **Auth Scheme:** Select **SFTP**.
* **SSH Auth Mode:** Select the authentication mode to use when establishing an SSH tunnel to the service. The default mode is **Password**.
* **SSH User:** Enter the SSH user.
* (Optional) **SSH Password:** Enter the SSH password.

## Complete Your Connection

To complete your connection:

1. Specify the following properties:
   * **Format:** Select the data structuring standard used by the REST source to which you want to connect. The default standard is **JSON**.
   * **Data Model:** Select the data model that you want to use to parse documents for your format and to generate the database metadata. The default data model is **Document**.
   * **JSON Format:** Select the format of the JSON document. The default value is **JSON**.
   * (Optional) **XPath:** Enter the XML path that repeats at the same level within the XML document. You can specify multiple paths in a semicolon-separated list.
   * **AWS Region:** Select the region that hosts your Amazon Web Services. The default region is **NORTHERNVIRGINIA**.
   * (Optional) **Storage Base URL:** Enter the URL of your cloud-storage service provider.
2. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. {oauthschemes ? `If you authenticate with ${oauthschemes}, click` : "Click"} **Connect to {datasource}** to connect to your {pageTitle} account.
4. Click **Create & Test** to create your connection.

## More Information

<CommonDatasourceMoreInformation datasource={datasource} advancedurl={advancedurl} siteName={siteName} driverVersion={driverVersion} />
