July 31, 2023

tGoogleDriveConnection – Docs for ESB Google Drive 7.x

tGoogleDriveConnection

Opens a Google Drive connection that can be reused by other Google Drive
components.

tGoogleDriveConnection Standard properties

These properties are used to configure tGoogleDriveConnection running in the Standard Job framework.

The Standard
tGoogleDriveConnection component belongs to the Cloud family.

The component in this framework is available in all Talend
products
.

Basic settings

Property Type

Select the way the connection details
will be set.

  • Built-In: The connection details will be set
    locally for this component. You need to specify the values for all
    related connection properties manually.

  • Repository: The connection details stored
    centrally in Repository > Metadata will be reused by this component. You need to click
    the […] button next to it and in the pop-up
    Repository Content dialog box, select the
    connection details to be reused, and all related connection
    properties will be automatically filled in.

Application Name

The application name required by Google Drive to get access to its
APIs.

OAuth Method

Select an OAuth method used to
access Google Drive from the drop-down list.

  • Access Token (deprecated):
    uses an access token to access Google Drive.

  • Installed Application (Id &
    Secret)
    : uses the client ID and client secret created through Google
    API Console to access Google Drive. For more information about this method, see
    Google Identity Platform > Installed
    applications
    .

  • Installed Application
    (JSON)
    : uses the client secret JSON file that is created through Google
    API Console and contains the client ID, client secret, and other OAuth 2.0
    parameters to access Google Drive.

  • Service Account: uses a
    service account JSON file created through Google API Console to access Google Drive.
    For more information about this method, see Google Identity Platform > Service
    accounts
    .

For more detailed information about how to access Google Drive using
each method, see OAuth methods for accessing Google Drive.

Access Token

The access token generated through Google Developers OAuth 2.0
Playground.

This property is available only when Access
Token
is selected from the OAuth
Method
drop-down list.

Client ID and Client Secret

The client ID and client secret.

These two properties are available only when Installed Application (Id & Secret) is selected from the OAuth Method drop-down list.

Client Secret JSON

The path to the client secret JSON file.

This property is available only when Installed Application (JSON) is selected from the OAuth Method drop-down list.

Service Account JSON

The path to the service account JSON file.

This property is available only when Service
Account
is selected from the OAuth
Method
drop-down list.

Use Proxy

Select this check box when you are working behind a proxy. With this
check box selected, you need to specify the value for the following parameters:

  • Host: The IP address of the
    HTTP proxy server.

  • Port: The port number of the
    HTTP proxy server.

Use SSL

Select this check box if an SSL connection is used to access Google
Drive. With this check box selected, you need to specify the value for the following
parameters:

  • Algorithm: The name of the
    SSL cryptography algorithm.

  • Keystore File: The path to
    the certificate TrustStore file that contains the list of certificates the client
    trusts.

  • Password: The password used
    to check the integrity of the TrustStore data.

Advanced settings

DataStore Path

The path to the
credential file that stores the refresh token.

Note: When your
client ID, client secret, or any other configuration related to the Installed
Application authentication changes, you need to delete this credential file manually
before running your Job again.

This property is available
only when Installed Application (Id &
Secret)
or Installed Application
(JSON)
is selected from the OAuth
Method
drop-down list.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level
as well as at each component level.

Global Variables

ERROR_MESSAGE

The error message generated by the component when an error occurs. This is an After
variable and it returns a string.

Usage

Usage rule

This component is more commonly used with other Google Drive components. In a Job
design, it is usually used to open a Google Drive connection that
can be reused by other Google Drive components.

OAuth methods for accessing Google Drive

Talend provides the following four OAuth methods to access Google Drive using Google
Drive components and metadata wizard.

  • Installed Application (Id & Secret)

  • Installed Application (JSON)

  • Service Account

  • Access Token (deprecated)

How to access Google Drive using client ID and secret

To use client ID and client secret to access Google Drive, you need to first
generate the client ID and client secret by completing the following steps using Google
Chrome.

A Google account has already been signed up for using Google Drive.

  1. Go to Google API Console and select an existing project or
    create a new one. In this example, we create a new project
    TalendProject.

    tGoogleDriveConnection_1.png

  2. Go to the Library page and in the right panel, find
    Google Drive API and enable the Google Drive API that
    allows you to access resources from Google Drive.

    tGoogleDriveConnection_2.png

  3. Go to the Credentials page, click OAuth
    consent screen
    in the right panel and set a product name in the
    Product name shown to users field. In this example,
    it is TalendProduct. When done, click
    Save.

    tGoogleDriveConnection_3.png

  4. Click Create credentials > OAuth client
    ID
    , and in the Create client ID page,
    create a new client ID TalendApplication with
    Application type set to
    Other.

    tGoogleDriveConnection_4.png

  5. Click Create. You will be shown your client ID and
    client secret that can be used by Google Drive components and metadata wizard to
    access Google Drive using the OAuth method Installed Application (Id
    & Secret)
    .

    tGoogleDriveConnection_5.png

How to access Google Drive using a client secret JSON file

To use a client secret JSON file to access Google Drive, you need to first download the
client secret JSON file from Google API Console by completing the following steps using
Google Chrome.

The client ID and client secret have been created in Google API Console. For more
information, see How to access Google Drive using client ID and secret.

  1. Go to Google API Console.
  2. Go to the Credentials page.
  3. Click the Download JSON button to download the client
    secret JSON file and securely store it in a local folder. This JSON file can
    then be used by Google Drive components and metadata wizard to access Google
    Drive via the OAuth method Installed Application
    (JSON)
    .

    tGoogleDriveConnection_6.png

How to access Google Drive using a service account JSON file

To use a service account JSON file to access Google Drive, you need to first create a
service account in Google API Console, then download the service account JSON file by
completing the following steps using Google Chrome.

  1. A Google account has already been signed up for using Google Drive.
  2. In Google API Console, your project has been created, the Google Drive API has
    been enabled, and the product name has been set. For more information about how
    to make these configuration, see How to access Google Drive using client ID and secret.
  1. Go to Google API Console.
  2. Open the Service accounts page. If prompted,
    select your project.

    tGoogleDriveConnection_7.png

  3. Click CREATE SERVICE ACCOUNT.
  4. In the Create service account window, type a name for
    the service account, select Furnish a new private key and
    then the key type JSON.

    tGoogleDriveConnection_8.png

  5. Click Create. In the pop-up window, choose a folder and
    click Save to store your service account JSON file
    securely. This JSON file can then be used by Google Drive components and
    metadata wizard to access Google Drive via the OAuth method Service
    Account
    .

How to access Google Drive using an access token (deprecated)

To use an access token to access Google Drive, you need to first generate the access
token by completing the following steps using Google Developers OAuth
Playground.

  1. A Google account has already been signed up for using Google Drive.
  2. The client ID and client secret have been created in Google API Console. For
    more information, see How to access Google Drive using client ID and secret.
  1. Go to Google Developers OAuth
    Playground
    .
  2. Click OAuth 2.0 Configuration and select Use
    your own OAuth credentials
    check box, enter the OAuth client ID
    and client secret you have already created in the OAuth Client
    ID
    and OAuth Client secret fields
    respectively.

    tGoogleDriveConnection_9.png

  3. In OAuth 2.0 Playground Step 1, select the scope
    https://www.googleapis.com/auth/drive under
    Drive API v3 for the Google Drive API and click
    Authorize APIs, then click
    Allow to generate the authorization code.

    tGoogleDriveConnection_10.png

  4. In OAuth 2.0 Playground Step 2, click
    Exchange authorization code for tokens to generate
    the OAuth access token.

    tGoogleDriveConnection_11.png

    The OAuth access token is displayed on the right panel as shown in below
    figure. It can be used by Google Drive components and metadata wizard to
    access Google Drive via the OAuth method Access
    Token
    .

    tGoogleDriveConnection_12.png

    Note that the access token expires in every 3600 seconds. You can click
    Refresh access token in OAuth 2.0
    Playground Step 2
    to refresh it.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x