Configure OAuth Authentication

You must configure OAuth authentication so that the connector can authenticate with Google Drive. Use one of the following procedures:

Retrieve Information from a single Google Drive

To configure OAuth authentication

  1. Open the folder where you installed the connector.
  2. Open the file oauth_tool.cfg in a text editor.
  3. In the [Default] section, set any SSL or proxy settings that are required to access the repository:

    SSLMethod The version of SSL/TLS to use.
    ProxyHost The host name or IP address of the proxy server to use.
    ProxyPort The port of the proxy server to use.

    For example:

    SSLMethod=NEGOTIATE
    ProxyHost=10.0.0.1
    ProxyPort=8080
  4. In the [OAuthTool] section, set the following parameters:

    AppKey The client ID that you obtained when you set up the OAuth application.
    AppSecret The client secret that you obtained when you set up the OAuth application.

    Do not modify the other parameters in this section.

  5. Open a command-line window and run the following command:

    oauth_tool.exe oauth_tool.cfg OAuthTool

    Your default web browser opens to the Google Drive web site. The web page asks you to authorize the connector to access Google Drive.

  6. Log in and grant consent.

    The OAuth tool creates a file named oauth.cfg, which contains the parameters that the connector requires to authenticate with Google Drive. When you configure the connector, import the parameters from oauth.cfg into your task configuration. For more information about including parameters from another file, see Include an External Configuration File.

  7. You can now configure a task to retrieve data from Google Drive. See Use the Connector.

Retrieve Information from G Suite Users

When you created a service account for accessing information from G Suite users (see Before you Install the Connector), Google provided a JSON file. The file contains various properties, including private_key and client_email. You must use these properties with the OAuth configuration tool to produce an OAuth sites file that the connector requires to access the information from users in the G Suite domain. After you complete the following procedure, the JSON file is no longer required.

To configure OAuth authentication

  1. Open the folder where you installed the connector.
  2. Open the file oauth_tool.cfg in a text editor.
  3. In the [GoogleServiceAccount] section, find the parameter CustomJson.
  4. Replace the strings <client_email> and <private_key> with the corresponding property values from the JSON file provided by Google.

    The value for the private key property should include the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- delimiters, and should include any newline (\n) characters. For example:

    CustomJson={"GoogleServiceAccount":"myaccount@myproject.iam.gserviceaccount.com","GoogleServiceAccountPrivateKey":"-----BEGIN PRIVATE KEY-----\nBASE64\n-----END PRIVATE KEY-----\n"}
  5. From the command line, run the following command. The arguments to this command are the name of OAuth tool configuration file and the relevant section name:

    oauth_tool oauth_tool.cfg GoogleServiceAccount

    The OAuth tool creates (or modifies) the file oauth2_sites.bin, to store the private key encrypted against the specified SiteName. It also creates a file named oauth.cfg. This contains the configuration parameters required by the connector to authenticate with Google Drive. You can import the contents of this file into the connector's configuration file with the following syntax:

    [MyTask1] < "oauth.cfg" [OAUTH]

    For more information about including parameters from another file, see Include an External Configuration File.