# Service Account Key Credentials

## Creating Service Account

To use Service account option first create Service account in your [project](https://docs.google.com/document/d/1acfbhhPGq2LSyd7Lfr2_8n2niinnefc0KTmxsvyECSQ/edit?pli=1#heading=h.5lkf2unccl26) as below:

* Navigate to the APIs & Services→Credentials panel in Cloud Console.

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

* Click \[+ Create Credentials], then select Service Account from the drop down menu.

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

* Under Service account details
  1. Enter a name
  2. The ID is generated.
  3. Add description for the service account.&#x20;

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

* Users can also optionally set up the “Grant this service account access to the project” and “Grant users access to this service account”.&#x20;

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

* To continue after Service account details, click \[Create and continue].

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

* To configure Grant access options, move to the next step.
  1. Optional: Under Grant this service account access to the project, select the IAM roles to grant to the service account.&#x20;
  2. Optional: Under Grant users access to this service account, add the users or groups that are allowed to use and manage the service account.&#x20;
  3. After defining any or both of the above, click \[Done].

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

## Creating Service Account Key

After creating a Service Account, create a Service Account Key as follows:

* In the created Project>Credentials section, click the email address or edit icon to generate a key for this service account.

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

* Service Account Settings display.

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

* Select the Keys tab and click the Add Key drop-down list.

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

* Click Create new key.

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

* Select JSON and click \[Create].&#x20;

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

* A JSON file will be downloaded automatically.
* New public/private key pair is generated and downloaded to your machine. Open the json file that is just downloaded and provide the required details by selecting the details from the file between double quotes (client\_id, client\_email, private\_key) while creating connector in Langstack.
* Open the Json file to see the details of the credentials.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/in-depth-learning/connectors/google-drive-connector/setting-up-gcp-account-gcp-project-api-enablement-and-credentials-prerequisites/service-account-key-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
