CData ODBC Driver for BigCommerce 2019J - Online Help

ヘッドレスマシン

CData ODBC Driver for BigCommerce 2019J - Build 19.0.7354

Note: This page follows the BigCommerce アプリの作成 method. If you have not created your own app and instead are following BigCommerce からのOAuthAccess トークンの生成, you can ignore this page.

Using OAuth on a Headless Machine

To create BigCommerce data sources on headless servers or other machines on which the 本製品 cannot open a browser, you need to authenticate from another machine. Authentication is a two-step process.

  1. Instead of installing the 本製品 on another machine, you can follow the steps below to obtain the OAuthVerifier value. Or, you can install the 本製品 on another machine and transfer the OAuth authentication values, after you authenticate through the usual browser-based flow.
  2. You can then configure the 本製品 to automatically refresh the access token from the headless machine.
You can follow the headless OAuth authentication flow using the 本製品's embedded OAuth credentials or using the OAuth credentials for your custom OAuth app.

Note that the headless OAuth flow uses several undocumented connection properties -- you can set these in the connection string as usual.

Using the Embedded OAuth Credentials

Obtain a Verifier Code

Follow the steps below to authenticate from another machine and obtain the OAuthVerifier connection property:

  1. Open the OAuth Authorization URL in your browser.
  2. Log in and grant permissions to the 本製品. You are then redirected to the callback URL, which contains the verifier code.
  3. Save the value of the verifier code. You will set this in the OAuthVerifier connection property.

On the headless machine, set the following connection properties to obtain the OAuth authentication values.

  • OAuthVerifier: Set this to the verifier code.
  • InitiateOAuth: Set this to GETANDREFRESH.
  • OAuthSettingsLocation: Set this to persist the encrypted OAuth authentication values to the specified file.
  • StoreId: Set this to your StoreId. For additional information on how to find your BigCommerce's Store Id, please see 接続の確立.

After the OAuth settings file is generated, set the following properties to connect to data:

  • OAuthSettingsLocation: Set this to the file containing the encrypted OAuth authentication values. Make sure this file gives read and write permissions to the 本製品 to enable the automatic refreshing of the access token.
  • InitiateOAuth: Set this to GETANDREFRESH.
  • StoreId: Set this to your StoreId.

Transfer OAuth Settings

Follow the steps below to install the 本製品 on another machine, authenticate, and then transfer the resulting OAuth values.

On a second machine, install the 本製品 and connect with the following properties set:

  • OAuthSettingsLocation: Set this to a writable text file.
  • StoreId: Set this to your StoreId.
Test the connection to authenticate in the browser. The resulting authentication values are written, encrypted, to the path specified by OAuthSettingsLocation. Once you have successfully tested the connection, copy the OAuth settings file to your headless machine.

On the headless machine, set the following connection properties to connect to data:

  • InitiateOAuth: Set this to GETANDREFRESH.
  • OAuthSettingsLocation: Set this to the path to your OAuth settings file. Make sure this file gives read and write permissions to the 本製品 to enable the automatic refreshing of the access token.
  • StoreId: Set this to your StoreId.

Using the Credentials for a Custom OAuth App

Create a Custom OAuth App

Creating a custom OAuth app is optional in the headless OAuth flow; you can skip creating an app by connecting with the 本製品's embedded OAuth credentials. You might want to create a custom OAuth app to change the information displayed when users log into BigCommerce to grant permissions to the 本製品.

See BigCommerce アプリの作成 for more information. You can then follow the procedures below to authenticate and connect to data.

Obtain a Verifier Code

Set the following properties on the headless machine:

  • InitiateOAuth: Set this to OFF.
  • OAuthClientId: Set this to the Client Id in your app settings.
  • OAuthClientSecret: Set this to the Client Secret in your app settings.
  • StoreId: Set this to your StoreId. For additional information on how to find your BigCommerce's Store Id, please see 接続の確立.

You can then follow the steps below to authenticate from another machine and obtain the OAuthVerifier connection property.

  1. Call the GetOAuthAuthorizationURL stored procedure with the CallbackURL input parameter set to the exact Redirect URI you specified in your app settings.
  2. Open the returned URL in a browser. Log in and grant permissions to the 本製品. You are then redirected to the callback URL, which contains the verifier code.
  3. Save the value of the verifier code. You will set this in the OAuthVerifier connection property.

On the headless machine, set the following connection properties to obtain the OAuth authentication values:

  • OAuthVerifier: Set this to the verifier code.
  • OAuthSettingsLocation: Set this to persist the encrypted OAuth authentication values to the specified file.
  • InitiateOAuth: Set this to GETANDREFRESH.

After the OAuth settings file is generated, set the following properties to connect to data:

  • OAuthSettingsLocation: Set this to the file containing the encrypted OAuth authentication values. Make sure this file gives read and write permissions to the provider to enable the automatic refreshing of the access token.
  • InitiateOAuth: Set this to GETANDREFRESH.
  • StoreId: Set this to your StoreId.

Transfer OAuth Settings

Follow the steps below to install the 本製品 on another machine, authenticate, and then transfer the resulting OAuth values.

On a second machine, install the 本製品 and connect with the following properties set:

  • OAuthSettingsLocation: Set this to a writable text file.
  • OAuthClientId: Set this to the client Id assigned when you registered your app.
  • OAuthClientSecret: Set this to the client secret assigned when you registered your app.
  • CallbackURL: Set this to the Redirect URI you specified in your app settings.
  • StoreId: Set this to your StoreId.

Test the connection to authenticate. The resulting authentication values are written, encrypted, to the path specified by OAuthSettingsLocation. Once you have successfully tested the connection, copy the OAuth settings file to your headless machine. On the headless machine, set the following connection properties to connect to data:

  • InitiateOAuth: Set this to GETANDREFRESH.
  • OAuthSettingsLocation: Set this to the path to your OAuth settings file. Make sure this file gives read and write permissions to the 本製品 to enable the automatic refreshing of the access token.
  • StoreId: Set this to your StoreId.

 
 
Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 19.0.7354.0