# Set up Google Drive Connector

* To go to the Connector module, select the Connector menu item under the Data Integration menu.
*

```
<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdconnmenu.png" alt=""><figcaption></figcaption></figure>
```

* In the Data Integration module click the \[+ Connector] button.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdaddconn.png" alt=""><figcaption></figcaption></figure>

* Enter Connector name and optionally provide a description.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdconnblankdet.png" alt=""><figcaption></figcaption></figure>

* Select Google Drive in Connector settings.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdselgd.png" alt=""><figcaption></figcaption></figure>

* Select any of the following three authentication types set up in Google Account :&#x20;
  * OAuth 2.0 client (default option)&#x20;
  * Service account key&#x20;
  * API Key

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdauthtypes.png" alt=""><figcaption></figcaption></figure>

#### OAuth 2.0 client

In the Connector settings, the OAuth 2.0 client Credentials Types settings are displayed.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdoauth2client.png" alt=""><figcaption></figcaption></figure>

* Enter the credentials Client ID and Client Secret generated in Google Account setup>OAuth 2.0 Client credentials and click \[Save].

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdoauth2clientcredmask.png" alt=""><figcaption></figcaption></figure>

* On clicking the \[Save] button, the “Authorize by” section is activated and a redirect URL is generated.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdauthbygd.png" alt=""><figcaption></figcaption></figure>

* For **authorization through Redirect URL**, follow the instructions below the url: ‘Copy the url and add it in google account credential OAuth 2.0 Client IDs -> Click edit or create new -> Under “Authorized redirect URIs”, Click Add URI.’
  * This generated URL needs to be copied and entered into Authorized Redirect URIs in OAuth 2.0 Client ID of created credentials in the Google Account. (See [steps](https://docs.langstack.com/welcome/in-depth-learning/connectors/google-drive-connector/setting-up-gcp-account-gcp-project-api-enablement-and-credentials-prerequisites/authorization-through-redirect-urls) to add the Redirect URL).
  * When the URL is copied, click the \[Sign in with Google] button which will take the user to the consent screen. In this step, the user is asked to enter information indicating their agreement to the connection Langstack is trying to establish with Google Drive.&#x20;

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdsigninwithgoogle.png" alt=""><figcaption></figcaption></figure>

* Once the user consent is acknowledged successfully, the \[Test connection] button is enabled. Click the \[Test connection] button to confirm if the connection is established.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdtestconnection.png" alt=""><figcaption></figcaption></figure>

* #### Service Account Key

  To establish a connection through Service Account Key Option:

  * Select Service account key. Enter the credentials generated in Google Account setup>.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdsaksettings.png" alt=""><figcaption></figcaption></figure>

Enter the following credentials from the Json file downloaded from GCP during Google Account setup>Service Account Key credentials and click \[Save]:&#x20;

* Client Id
* Client Email address
* Service account user: This is the email of the user account to impersonate, if delegating domain-wide authority to the service account.
* Private Key (private\_key) object for the service account in "PKCS#8" format.&#x20;

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdsakcredsadded.png" alt=""><figcaption></figcaption></figure>

* Test the connection by clicking the \[Test connection] button.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdsaktestconnection.png" alt=""><figcaption></figcaption></figure>

* #### API Key

  To establish connection through API Key Option:

  * Select API key. The relevant settings display.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeyset.png" alt=""><figcaption></figcaption></figure>

* Enter the API Key generated in Google Account setup>API Key credentials and click \[Save].

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeycredadded.png" alt=""><figcaption></figcaption></figure>

* The \[Test Connection] button becomes activated and the API Key gets encrypted.
* Test the connection by clicking the \[Test connection] button.

<figure><img src="https://media.langstack.com/documentation/media/images/connector/googledriveconnector/gdapikeytestconnection.png" alt=""><figcaption></figcaption></figure>
