creds to manual, split google

This commit is contained in:
Deborah Barnard 2022-10-11 13:16:00 +01:00
parent 4add3912f0
commit a451df84a6
5 changed files with 440 additions and 184 deletions

View File

@ -1,183 +0,0 @@
# Google
There are two authentication methods available for Google services nodes, [OAuth2](https://developers.google.com/identity/protocols/oauth2){:target=_blank .external-link} and [Service Account](https://cloud.google.com/iam/docs/understanding-service-accounts){:target=_blank .external-link}. Usually, n8n recommends using OAuth. It's more widely available, and easier to set up. Refer to the [Google documentation: Understanding service accounts](https://cloud.google.com/iam/docs/understanding-service-accounts){:target=_blank .external-link} for guidance on when you need service account.
## Prerequisites
* [Google Cloud](https://cloud.google.com/){:targe=_blank .external-link} account
* [Google Cloud Platform project](https://developers.google.com/workspace/marketplace/create-gcp-project){:targe=_blank .external-link}
* If using Google Perspective: [Request API Access](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link}
* If using Google Ads: [Developer Token](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}
## Compatible nodes
Once configured, you can use your credentials to authenticate the following nodes. Most nodes are compatible with OAuth2 authentication. Support for Service Account authentication is limited.
| Node | OAuth | Service Account |
| :--- | :---: | :-------------: |
| [G Suite Admin](/integrations/builtin/app-nodes/n8n-nodes-base.gSuiteAdmin/) | :white_check_mark: | :x: |
| [Google Ads](/integrations/builtin/app-nodes/n8n-nodes-base.googleAds/) | :white_check_mark: | :x: |
| [Gmail](/integrations/builtin/app-nodes/n8n-nodes-base.gmail/) | :white_check_mark: | :white_check_mark: |
| [Google Analytics](/integrations/builtin/app-nodes/n8n-nodes-base.googleAnalytics/) | :white_check_mark: | :x: |
| [Google BigQuery](/integrations/builtin/app-nodes/n8n-nodes-base.googleBigQuery/) | :white_check_mark: | :x: |
| [Google Books](/integrations/builtin/app-nodes/n8n-nodes-base.googleBooks/) | :white_check_mark: | :white_check_mark: |
| [Google Calendar](/integrations/builtin/app-nodes/n8n-nodes-base.googleCalendar/) | :white_check_mark: | :x: |
| [Google Chat](/integrations/builtin/app-nodes/n8n-nodes-base.googleChat/) | :x: | :white_check_mark: |
| [Google Cloud Storage](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudStorage/) | :white_check_mark: | :x: |
| [Google Contacts](/integrations/builtin/app-nodes/n8n-nodes-base.googleContacts/) | :white_check_mark: | :x: |
| [Google Cloud Firestore](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudFirestore/) | :white_check_mark: | :x: |
| [Google Cloud Natural Language](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudNaturalLanguage/) | :white_check_mark: | :x: |
| [Google Cloud Realtime Database](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudRealtimeDatabase/) | :white_check_mark: | :x: |
| [Google Docs](/integrations/builtin/app-nodes/n8n-nodes-base.googleDocs/) | :white_check_mark: | :white_check_mark: |
| [Google Drive](/integrations/builtin/app-nodes/n8n-nodes-base.googleDrive/) | :white_check_mark: | :white_check_mark: |
| [Google Drive Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.googleDriveTrigger/) | :white_check_mark: | :white_check_mark: |
| [Google Perspective](/integrations/builtin/app-nodes/n8n-nodes-base.googlePerspective/) | :white_check_mark: | :x: |
| [Google Sheets](/integrations/builtin/app-nodes/n8n-nodes-base.googleSheets/) | :white_check_mark: | :white_check_mark: |
| [Google Slides](/integrations/builtin/app-nodes/n8n-nodes-base.googleSlides/) | :white_check_mark: | :white_check_mark: |
| [Google Tasks](/integrations/builtin/app-nodes/n8n-nodes-base.googleTasks/) | :white_check_mark: | :x: |
| [Google Translate](/integrations/builtin/app-nodes/n8n-nodes-base.googleTranslate/) | :white_check_mark: | :white_check_mark: |
| [YouTube](/integrations/builtin/app-nodes/n8n-nodes-base.youTube/) | :white_check_mark: | :x: |
!!! note "Note for n8n Cloud users"
For the following nodes, you can authenticate by entering the **Credentials Name** and selecting **Sign in with Google** in the OAuth section to connect your Google account to n8n:
* [Google Calendar](/integrations/builtin/app-nodes/n8n-nodes-base.googleCalendar/)
* [Google Contacts](/integrations/builtin/app-nodes/n8n-nodes-base.googleContacts/)
* [Google Sheets](/integrations/builtin/app-nodes/n8n-nodes-base.googleSheets/)
* [Google Tasks](/integrations/builtin/app-nodes/n8n-nodes-base.googleTasks/)
## Using OAuth
### Create a new credential in n8n
1. Follow the steps to [Create a credential](/credentials/add-edit-credentials/). If you create a credential by selecting **Create new** in the credentials dropdown in a node, n8n automatically creates the correct credential type for that node. If you select **Credentials > New**, you must browse for the credential type:
* To connect with a specific service, using resources and operations supported by n8n, choose that service. For example, to create a credential for use in the Gmail node, search for `Gmail`.
* To create a credential for a [custom API call](/integrations/custom-operations/), select **Google OAuth2 API**. This allows you to create a generic credential, then set its scopes.
2. Note the **OAuth Redirect URL** from the node credential modal. You'll need this in the next section.
![OAuth Callback URL](/_images/integrations/builtin/credentials/google/oauth_callback.png)
3. If you're creating a generic Google OAuth2 API credential (rather than a credential for a specific service), you must provide the scopes for this credential. Refer to [Scopes](#scopes) for more information.
### Set up OAuth in Google Cloud
1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials){:target=_blank .external-link} and make sure you're in the project you want to use.
2. Select **+ CREATE CREDENTIALS > OAuth client ID**. If you're creating OAuth credentials for the first time, you must [configure the consent screen](https://support.google.com/cloud/answer/10311615?hl=en&ref_topic=3473162){:target=_blank .external-link}.
3. In the **Application type** dropdown, select **Web application**. Google automatically generates a name.
4. In Google Cloud, select **+ ADD URI**. Paste in the OAuth redirect URL from the previous step.
5. Select **CREATE**.
6. Enable each Google service API that you want to use:
--8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md"
### Create and test your connection
In n8n:
1. Enter your new **Client ID** and **Client Secret** from Google Cloud Console in the credentials modal.
2. Select **Sign in with Google** to complete your Google authentication.
3. **Save** your new credentials.
The following video demonstrates the steps described above:
<div class="video-container">
<iframe width="840" height="472.5" src="https://www.youtube.com/embed/gZ6N2H3_vys" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
## Using Service Account
Using service accounts is more complex than OAuth2. Before you begin:
* Make sure you really need to use service account. For most use cases, OAuth2 is a better option.
* Read the Google documentation on [Creating and managing service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts){:target=_blank .external-link}.
### Create a new credential in n8n
1. Follow the steps to [Create a credential](/credentials/add-edit-credentials/).
!!! note "Generic and specific credentials"
If you create a credential by selecting **Create new** in the credentials dropdown in a node, n8n automatically creates the correct credential type for that node. If you select **Credentials > New**, you must browse for the credential type:
* To connect with a specific service, using resources and operations supported by n8n, choose that service. For example, to create a credential for use in the Gmail node, search for `Gmail`.
* To create a credential for a [custom API call](/integrations/custom-operations/), select **Google API**.
2. Note the **Private Key** from the node credential modal. You'll need this in the next section.
### Set up service account in Google Cloud
In your [Google Cloud Console](https://console.cloud.google.com){:target=_blank .external-link} dashboard:
1. Select the hamburger menu **> APIs & Services > Credentials**. Google takes you to your **Credentials** page.
2. Select **+ CREATE CREDENTIALS > Service account**.
3. Enter a name in **Service account name**, and an ID in **Service account ID**. Refer to [Creating a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts?hl=en#creating){:target=_blank .external-link} for more information.
4. Select **CREATE AND CONTINUE**.
5. Based on your use-case, you may want to **Select a role** and **Grant users access to this service account** using the corresponding sections.
6. Select **DONE**.
7. Select your newly created service account under the **Service Accounts** section. Open the **KEYS** tab.
8. Select **ADD KEY > Create new key**.
9. In the modal that appears, select **JSON**, then select **CREATE**. Google saves the file to your computer.
10. Enable each Google service API that you want to use:
--8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md"
### Create and test your connection
In n8n:
1. In the **Service Account Email** field, enter the email associated with your new Service Account (you can find this in the **Details** tab in Google Cloud).
2. Enter the **Private Key** from the downloaded JSON file. If you're running an n8n version older than 0.156.0: replace all instances of `\n` in the JSON file with new lines.
3. **Optional**: Click the toggle to enable [**Impersonate a User**](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority){:target=_blank .external-link} and enter the email.
4. **Save** your credentials.
The following video demonstrates the steps described above.
<div class="video-container">
<iframe width="840" height="472.5" src="https://www.youtube.com/embed/ArXVlpo3y1k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
## Scopes
Many Google services have multiple possible access scopes. A scope limits what a user can do. Refer to [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes){:target=_blank .external-link} for a list of scopes for all services.
n8n doesn't support all scopes. When creating a generic Google OAuth2 API credential, you can enter scopes from the list. If you enter a scope that n8n doesn't already support, it won't work.
??? Details "Supported scopes"
| Service | Available scopes |
| ------- | ---------------- |
| Gmail | https://www.googleapis.com/auth/gmail.labels <br /> https://www.googleapis.com/auth/gmail.addons.current.action.compose <br /> https://www.googleapis.com/auth/gmail.addons.current.message.action <br /> https://mail.google.com/ <br /> https://www.googleapis.com/auth/gmail.modify <br /> https://www.googleapis.com/auth/gmail.compose |
| Google Ads | https://www.googleapis.com/auth/adwords |
| Google Analytics | https://www.googleapis.com/auth/analytics <br /> https://www.googleapis.com/auth/analytics.readonly |
| Google Big Query | https://www.googleapis.com/auth/bigquery |
| Google Books | https://www.googleapis.com/auth/books |
| Google Calendar | https://www.googleapis.com/auth/calendar <br /> https://www.googleapis.com/auth/calendar.events |
| Google Cloud Natural Language | https://www.googleapis.com/auth/cloud-language <br /> https://www.googleapis.com/auth/cloud-platform |
| Google Cloud Storage | https://www.googleapis.com/auth/cloud-platform <br /> https://www.googleapis.com/auth/cloud-platform.read-only <br /> https://www.googleapis.com/auth/devstorage.full_control <br /> https://www.googleapis.com/auth/devstorage.read_only <br /> https://www.googleapis.com/auth/devstorage.read_write |
| Google Contacts | https://www.googleapis.com/auth/contacts |
| Google Docs | https://www.googleapis.com/auth/documents <br /> https://www.googleapis.com/auth/drive <br /> https://www.googleapis.com/auth/drive.file |
| Google Drive | https://www.googleapis.com/auth/drive <br /> https://www.googleapis.com/auth/drive.appdata <br /> https://www.googleapis.com/auth/drive.photos.readonly |
| Google Firebase Cloud Firestore | https://www.googleapis.com/auth/datastore <br /> https://www.googleapis.com/auth/firebase |
| Google Firebase Realtime Database | https://www.googleapis.com/auth/userinfo.email <br /> https://www.googleapis.com/auth/firebase.database <br /> https://www.googleapis.com/auth/firebase |
| Google Perspective | https://www.googleapis.com/auth/userinfo.email |
| Google Sheets | https://www.googleapis.com/auth/drive.file <br /> https://www.googleapis.com/auth/spreadsheets |
| Google Slide | https://www.googleapis.com/auth/drive.file <br /> https://www.googleapis.com/auth/presentations |
| Google Tasks | https://www.googleapis.com/auth/tasks |
| Google Translate | https://www.googleapis.com/auth/cloud-translation |
| GSuite Admin | https://www.googleapis.com/auth/admin.directory.group <br /> https://www.googleapis.com/auth/admin.directory.user <br /> https://www.googleapis.com/auth/admin.directory.domain.readonly <br /> https://www.googleapis.com/auth/admin.directory.userschema.readonly |
## Troubleshooting
### Google hasn't verified this app
If using the OAuth authentication method, you might see the warning **Google hasn't verified this app**. To avoid this, you can create OAuth credentials from the same account you want to authenticate. However, if you're using credentials that were generated by another account (by a developer or another third party), do the following in Google Cloud:
1. Select**Advanced**.
2. Select **Go to CREDENTIALS_NAME (unsafe)**. `CREDENTIALS_NAME` is the name of the credentials created by the third party.
3. Grant the requested permissions.
### Service Account cannot access Google Drive files
A Service Account can't access Google Drive files and folders that weren't shared with its associated user email.
1. Access your [Google Cloud Console](https://console.cloud.google.com){:target=_blank .external-link} and copy your Service Account email.
2. Access your [Google Drive](https://drive.google.com){:target=_blank .external-link} and go to the designated file or folder.
3. Right-click on the file or folder and select **Share**.
4. Paste your Service Account email into **Add People and groups**.
5. Select **Editor** for read-write access or **Viewer** for read-only access.

View File

@ -0,0 +1,47 @@
# Google
There are two authentication methods available for Google services nodes, [OAuth2](https://developers.google.com/identity/protocols/oauth2){:target=_blank .external-link} and [Service Account](https://cloud.google.com/iam/docs/understanding-service-accounts){:target=_blank .external-link}. Usually, n8n recommends using OAuth. It's more widely available, and easier to set up. Refer to the [Google documentation: Understanding service accounts](https://cloud.google.com/iam/docs/understanding-service-accounts){:target=_blank .external-link} for guidance on when you need service account.
## Compatible nodes
Once configured, you can use your credentials to authenticate the following nodes. Most nodes are compatible with OAuth2 authentication. Support for Service Account authentication is limited.
??? Details "Compatibility"
| Node | OAuth | Service Account |
| :--- | :---: | :-------------: |
| [G Suite Admin](/integrations/builtin/app-nodes/n8n-nodes-base.gSuiteAdmin/) | :white_check_mark: | :x: |
| [Google Ads](/integrations/builtin/app-nodes/n8n-nodes-base.googleAds/) | :white_check_mark: | :x: |
| [Gmail](/integrations/builtin/app-nodes/n8n-nodes-base.gmail/) | :white_check_mark: | :white_check_mark: |
| [Google Analytics](/integrations/builtin/app-nodes/n8n-nodes-base.googleAnalytics/) | :white_check_mark: | :x: |
| [Google BigQuery](/integrations/builtin/app-nodes/n8n-nodes-base.googleBigQuery/) | :white_check_mark: | :x: |
| [Google Books](/integrations/builtin/app-nodes/n8n-nodes-base.googleBooks/) | :white_check_mark: | :white_check_mark: |
| [Google Calendar](/integrations/builtin/app-nodes/n8n-nodes-base.googleCalendar/) | :white_check_mark: | :x: |
| [Google Chat](/integrations/builtin/app-nodes/n8n-nodes-base.googleChat/) | :x: | :white_check_mark: |
| [Google Cloud Storage](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudStorage/) | :white_check_mark: | :x: |
| [Google Contacts](/integrations/builtin/app-nodes/n8n-nodes-base.googleContacts/) | :white_check_mark: | :x: |
| [Google Cloud Firestore](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudFirestore/) | :white_check_mark: | :x: |
| [Google Cloud Natural Language](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudNaturalLanguage/) | :white_check_mark: | :x: |
| [Google Cloud Realtime Database](/integrations/builtin/app-nodes/n8n-nodes-base.googleCloudRealtimeDatabase/) | :white_check_mark: | :x: |
| [Google Docs](/integrations/builtin/app-nodes/n8n-nodes-base.googleDocs/) | :white_check_mark: | :white_check_mark: |
| [Google Drive](/integrations/builtin/app-nodes/n8n-nodes-base.googleDrive/) | :white_check_mark: | :white_check_mark: |
| [Google Drive Trigger](/integrations/builtin/trigger-nodes/n8n-nodes-base.googleDriveTrigger/) | :white_check_mark: | :white_check_mark: |
| [Google Perspective](/integrations/builtin/app-nodes/n8n-nodes-base.googlePerspective/) | :white_check_mark: | :x: |
| [Google Sheets](/integrations/builtin/app-nodes/n8n-nodes-base.googleSheets/) | :white_check_mark: | :white_check_mark: |
| [Google Slides](/integrations/builtin/app-nodes/n8n-nodes-base.googleSlides/) | :white_check_mark: | :white_check_mark: |
| [Google Tasks](/integrations/builtin/app-nodes/n8n-nodes-base.googleTasks/) | :white_check_mark: | :x: |
| [Google Translate](/integrations/builtin/app-nodes/n8n-nodes-base.googleTranslate/) | :white_check_mark: | :white_check_mark: |
| [YouTube](/integrations/builtin/app-nodes/n8n-nodes-base.youTube/) | :white_check_mark: | :x: |
!!! note "Note for n8n Cloud users"
For the following nodes, you can authenticate by entering the **Credentials Name** and selecting **Sign in with Google** in the OAuth section to connect your Google account to n8n:
* [Google Calendar](/integrations/builtin/app-nodes/n8n-nodes-base.googleCalendar/)
* [Google Contacts](/integrations/builtin/app-nodes/n8n-nodes-base.googleContacts/)
* [Google Sheets](/integrations/builtin/app-nodes/n8n-nodes-base.googleSheets/)
* [Google Tasks](/integrations/builtin/app-nodes/n8n-nodes-base.googleTasks/)

View File

@ -0,0 +1,89 @@
# Google: OAuth2
There are two types of OAuth2 setup:
* Creating credentials for a specific service, associated with a single node. For example, creating credentials for use with the Gmail node.
* Creating a generic OAuth2 credential for use with [custom operations](/integrations/custom-operations/).
This document contains instructions for both options.
## Prerequisites
* [Google Cloud](https://cloud.google.com/){:targe=_blank .external-link} account
* [Google Cloud Platform project](https://developers.google.com/workspace/marketplace/create-gcp-project){:targe=_blank .external-link}
* If using Google Perspective: [Request API Access](https://developers.perspectiveapi.com/s/docs-get-started){:targe=_blank .external-link}
* If using Google Ads: [Developer Token](https://developers.google.com/google-ads/api/docs/first-call/dev-token){:targe=_blank .external-link}
## Set up OAuth
### Create a new credential in n8n
1. Follow the steps to [Create a credential](/credentials/add-edit-credentials/). If you create a credential by selecting **Create new** in the credentials dropdown in a node, n8n automatically creates the correct credential type for that node. If you select **Credentials > New**, you must browse for the credential type:
* To connect with a specific service, using resources and operations supported by n8n, choose that service. For example, to create a credential for use in the Gmail node, search for `Gmail`.
* To create a credential for a [custom API call](/integrations/custom-operations/), select **Google OAuth2 API**. This allows you to create a generic credential, then set its scopes.
2. Note the **OAuth Redirect URL** from the node credential modal. You'll need this in the next section.
![OAuth Callback URL](/_images/integrations/builtin/credentials/google/oauth_callback.png)
3. If you're creating a generic Google OAuth2 API credential (rather than a credential for a specific service), you must provide the scopes for this credential. Refer to [Scopes](#scopes) for more information.
### Set up OAuth in Google Cloud
1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials){:target=_blank .external-link} and make sure you're in the project you want to use.
2. Select **+ CREATE CREDENTIALS > OAuth client ID**. If you're creating OAuth credentials for the first time, you must [configure the consent screen](https://support.google.com/cloud/answer/10311615?hl=en&ref_topic=3473162){:target=_blank .external-link}.
3. In the **Application type** dropdown, select **Web application**. Google automatically generates a name.
4. In Google Cloud, select **+ ADD URI**. Paste in the OAuth redirect URL from the previous step.
5. Select **CREATE**.
6. Enable each Google service API that you want to use:
--8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md"
### Create and test your connection
In n8n:
1. Enter your new **Client ID** and **Client Secret** from Google Cloud Console in the credentials modal.
2. Select **Sign in with Google** to complete your Google authentication.
3. **Save** your new credentials.
The following video demonstrates the steps described above:
<div class="video-container">
<iframe width="840" height="472.5" src="https://www.youtube.com/embed/gZ6N2H3_vys" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
## Scopes
Many Google services have multiple possible access scopes. A scope limits what a user can do. Refer to [OAuth 2.0 Scopes for Google APIs](https://developers.google.com/identity/protocols/oauth2/scopes){:target=_blank .external-link} for a list of scopes for all services.
n8n doesn't support all scopes. When creating a generic Google OAuth2 API credential, you can enter scopes from the list. If you enter a scope that n8n doesn't already support, it won't work.
??? Details "Supported scopes"
| Service | Available scopes |
| ------- | ---------------- |
| Gmail | https://www.googleapis.com/auth/gmail.labels <br /> https://www.googleapis.com/auth/gmail.addons.current.action.compose <br /> https://www.googleapis.com/auth/gmail.addons.current.message.action <br /> https://mail.google.com/ <br /> https://www.googleapis.com/auth/gmail.modify <br /> https://www.googleapis.com/auth/gmail.compose |
| Google Ads | https://www.googleapis.com/auth/adwords |
| Google Analytics | https://www.googleapis.com/auth/analytics <br /> https://www.googleapis.com/auth/analytics.readonly |
| Google Big Query | https://www.googleapis.com/auth/bigquery |
| Google Books | https://www.googleapis.com/auth/books |
| Google Calendar | https://www.googleapis.com/auth/calendar <br /> https://www.googleapis.com/auth/calendar.events |
| Google Cloud Natural Language | https://www.googleapis.com/auth/cloud-language <br /> https://www.googleapis.com/auth/cloud-platform |
| Google Cloud Storage | https://www.googleapis.com/auth/cloud-platform <br /> https://www.googleapis.com/auth/cloud-platform.read-only <br /> https://www.googleapis.com/auth/devstorage.full_control <br /> https://www.googleapis.com/auth/devstorage.read_only <br /> https://www.googleapis.com/auth/devstorage.read_write |
| Google Contacts | https://www.googleapis.com/auth/contacts |
| Google Docs | https://www.googleapis.com/auth/documents <br /> https://www.googleapis.com/auth/drive <br /> https://www.googleapis.com/auth/drive.file |
| Google Drive | https://www.googleapis.com/auth/drive <br /> https://www.googleapis.com/auth/drive.appdata <br /> https://www.googleapis.com/auth/drive.photos.readonly |
| Google Firebase Cloud Firestore | https://www.googleapis.com/auth/datastore <br /> https://www.googleapis.com/auth/firebase |
| Google Firebase Realtime Database | https://www.googleapis.com/auth/userinfo.email <br /> https://www.googleapis.com/auth/firebase.database <br /> https://www.googleapis.com/auth/firebase |
| Google Perspective | https://www.googleapis.com/auth/userinfo.email |
| Google Sheets | https://www.googleapis.com/auth/drive.file <br /> https://www.googleapis.com/auth/spreadsheets |
| Google Slide | https://www.googleapis.com/auth/drive.file <br /> https://www.googleapis.com/auth/presentations |
| Google Tasks | https://www.googleapis.com/auth/tasks |
| Google Translate | https://www.googleapis.com/auth/cloud-translation |
| GSuite Admin | https://www.googleapis.com/auth/admin.directory.group <br /> https://www.googleapis.com/auth/admin.directory.user <br /> https://www.googleapis.com/auth/admin.directory.domain.readonly <br /> https://www.googleapis.com/auth/admin.directory.userschema.readonly |
## Troubleshooting
### Google hasn't verified this app
If using the OAuth authentication method, you might see the warning **Google hasn't verified this app**. To avoid this, you can create OAuth credentials from the same account you want to authenticate. However, if you're using credentials that were generated by another account (by a developer or another third party), do the following in Google Cloud:
1. Select**Advanced**.
2. Select **Go to CREDENTIALS_NAME (unsafe)**. `CREDENTIALS_NAME` is the name of the credentials created by the third party.
3. Grant the requested permissions.

View File

@ -0,0 +1,70 @@
# Google: Service Account
Using service accounts is more complex than OAuth2. Before you begin:
* Check if your node is [compatible](/integrations/builtin/credentials/google/#compatible-nodes) with Service Account.
* Make sure you really need to use service account. For most use cases, OAuth2 is a better option.
* Read the Google documentation on [Creating and managing service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts){:target=_blank .external-link}.
## Prerequisites
* [Google Cloud](https://cloud.google.com/){:targe=_blank .external-link} account
* [Google Cloud Platform project](https://developers.google.com/workspace/marketplace/create-gcp-project){:targe=_blank .external-link}
## Set up Service Account
### Create a new credential in n8n
1. Follow the steps to [Create a credential](/credentials/add-edit-credentials/).
!!! note "Generic and specific credentials"
If you create a credential by selecting **Create new** in the credentials dropdown in a node, n8n automatically creates the correct credential type for that node. If you select **Credentials > New**, you must browse for the credential type:
* To connect with a specific service, using resources and operations supported by n8n, choose that service. For example, to create a credential for use in the Gmail node, search for `Gmail`.
* To create a credential for a [custom API call](/integrations/custom-operations/), select **Google API**.
2. Note the **Private Key** from the node credential modal. You'll need this in the next section.
### Set up service account in Google Cloud
In your [Google Cloud Console](https://console.cloud.google.com){:target=_blank .external-link} dashboard:
1. Select the hamburger menu **> APIs & Services > Credentials**. Google takes you to your **Credentials** page.
2. Select **+ CREATE CREDENTIALS > Service account**.
3. Enter a name in **Service account name**, and an ID in **Service account ID**. Refer to [Creating a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts?hl=en#creating){:target=_blank .external-link} for more information.
4. Select **CREATE AND CONTINUE**.
5. Based on your use-case, you may want to **Select a role** and **Grant users access to this service account** using the corresponding sections.
6. Select **DONE**.
7. Select your newly created service account under the **Service Accounts** section. Open the **KEYS** tab.
8. Select **ADD KEY > Create new key**.
9. In the modal that appears, select **JSON**, then select **CREATE**. Google saves the file to your computer.
10. Enable each Google service API that you want to use:
--8<-- "_snippets/integrations/builtin/credentials/google/enable-apis.md"
### Create and test your connection
In n8n:
1. In the **Service Account Email** field, enter the email associated with your new Service Account (you can find this in the **Details** tab in Google Cloud).
2. Enter the **Private Key** from the downloaded JSON file. If you're running an n8n version older than 0.156.0: replace all instances of `\n` in the JSON file with new lines.
3. **Optional**: Click the toggle to enable [**Impersonate a User**](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority){:target=_blank .external-link} and enter the email.
4. **Save** your credentials.
The following video demonstrates the steps described above.
<div class="video-container">
<iframe width="840" height="472.5" src="https://www.youtube.com/embed/ArXVlpo3y1k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
## Troubleshooting
### Service Account cannot access Google Drive files
A Service Account can't access Google Drive files and folders that weren't shared with its associated user email.
1. Access your [Google Cloud Console](https://console.cloud.google.com){:target=_blank .external-link} and copy your Service Account email.
2. Access your [Google Drive](https://drive.google.com){:target=_blank .external-link} and go to the designated file or folder.
3. Right-click on the file or folder and select **Share**.
4. Paste your Service Account email into **Add People and groups**.
5. Select **Editor** for read-write access or **Viewer** for read-only access.

View File

@ -164,7 +164,240 @@ nav:
- Core nodes: integrations/builtin/core-nodes/
- App nodes: integrations/builtin/app-nodes/
- Trigger nodes: integrations/builtin/trigger-nodes/
- Credentials: integrations/builtin/credentials/
- Credentials:
- integrations/builtin/credentials/index.md
- integrations/builtin/credentials/actionnetwork.md
- integrations/builtin/credentials/activecampaign.md
- integrations/builtin/credentials/acuityscheduling.md
- integrations/builtin/credentials/adalo.md
- integrations/builtin/credentials/affinity.md
- integrations/builtin/credentials/agilecrm.md
- integrations/builtin/credentials/airtable.md
- integrations/builtin/credentials/amqp.md
- integrations/builtin/credentials/apitemplateio.md
- integrations/builtin/credentials/asana.md
- integrations/builtin/credentials/automizy.md
- integrations/builtin/credentials/autopilot.md
- integrations/builtin/credentials/aws.md
- integrations/builtin/credentials/bamboohr.md
- integrations/builtin/credentials/bannerbear.md
- integrations/builtin/credentials/baserow.md
- integrations/builtin/credentials/beeminder.md
- integrations/builtin/credentials/bitbucket.md
- integrations/builtin/credentials/bitly.md
- integrations/builtin/credentials/bitwarden.md
- integrations/builtin/credentials/box.md
- integrations/builtin/credentials/brandfetch.md
- integrations/builtin/credentials/bubble.md
- integrations/builtin/credentials/cal.md
- integrations/builtin/credentials/calendly.md
- integrations/builtin/credentials/chargebee.md
- integrations/builtin/credentials/circleci.md
- integrations/builtin/credentials/ciscowebex.md
- integrations/builtin/credentials/citrixadc.md
- integrations/builtin/credentials/clearbit.md
- integrations/builtin/credentials/clickup.md
- integrations/builtin/credentials/clockify.md
- integrations/builtin/credentials/cloudflare.md
- integrations/builtin/credentials/cockpit.md
- integrations/builtin/credentials/coda.md
- integrations/builtin/credentials/contentful.md
- integrations/builtin/credentials/convertkit.md
- integrations/builtin/credentials/copper.md
- integrations/builtin/credentials/cortex.md
- integrations/builtin/credentials/cratedb.md
- integrations/builtin/credentials/customerio.md
- integrations/builtin/credentials/deepl.md
- integrations/builtin/credentials/demio.md
- integrations/builtin/credentials/dhl.md
- integrations/builtin/credentials/discord.md
- integrations/builtin/credentials/discourse.md
- integrations/builtin/credentials/disqus.md
- integrations/builtin/credentials/drift.md
- integrations/builtin/credentials/dropbox.md
- integrations/builtin/credentials/dropcontact.md
- integrations/builtin/credentials/egoi.md
- integrations/builtin/credentials/elasticsearch.md
- integrations/builtin/credentials/elasticsecurity.md
- integrations/builtin/credentials/emelia.md
- integrations/builtin/credentials/erpnext.md
- integrations/builtin/credentials/eventbrite.md
- integrations/builtin/credentials/facebookapp.md
- integrations/builtin/credentials/facebookgraph.md
- integrations/builtin/credentials/figma.md
- integrations/builtin/credentials/filemaker.md
- integrations/builtin/credentials/flow.md
- integrations/builtin/credentials/formiotrigger.md
- integrations/builtin/credentials/formstacktrigger.md
- integrations/builtin/credentials/freshdesk.md
- integrations/builtin/credentials/freshservice.md
- integrations/builtin/credentials/freshworkscrm.md
- integrations/builtin/credentials/ftp.md
- integrations/builtin/credentials/getresponse.md
- integrations/builtin/credentials/ghost.md
- integrations/builtin/credentials/git.md
- integrations/builtin/credentials/github.md
- integrations/builtin/credentials/gitlab.md
- Google:
- integrations/builtin/credentials/google/index.md
- integrations/builtin/credentials/google/oauth.md
- integrations/builtin/credentials/google/service-account.md
- integrations/builtin/credentials/gotify.md
- integrations/builtin/credentials/gotowebinar.md
- integrations/builtin/credentials/grafana.md
- integrations/builtin/credentials/grist.md
- integrations/builtin/credentials/gumroad.md
- integrations/builtin/credentials/halopsa.md
- integrations/builtin/credentials/harvest.md
- integrations/builtin/credentials/helpscout.md
- integrations/builtin/credentials/highlevel.md
- integrations/builtin/credentials/homeassistant.md
- integrations/builtin/credentials/httprequest.md
- integrations/builtin/credentials/hubspot.md
- integrations/builtin/credentials/humanticai.md
- integrations/builtin/credentials/hunter.md
- integrations/builtin/credentials/imap.md
- integrations/builtin/credentials/intercom.md
- integrations/builtin/credentials/invoiceninja.md
- integrations/builtin/credentials/iterable.md
- integrations/builtin/credentials/jenkins.md
- integrations/builtin/credentials/jira.md
- integrations/builtin/credentials/jotform.md
- integrations/builtin/credentials/kafka.md
- integrations/builtin/credentials/keap.md
- integrations/builtin/credentials/kitemaker.md
- integrations/builtin/credentials/kobotoolbox.md
- integrations/builtin/credentials/lemlist.md
- integrations/builtin/credentials/line.md
- integrations/builtin/credentials/linear.md
- integrations/builtin/credentials/lingvanex.md
- integrations/builtin/credentials/linkedin.md
- integrations/builtin/credentials/magento2.md
- integrations/builtin/credentials/mailcheck.md
- integrations/builtin/credentials/mailchimp.md
- integrations/builtin/credentials/mailerlite.md
- integrations/builtin/credentials/mailgun.md
- integrations/builtin/credentials/mailjet.md
- integrations/builtin/credentials/mandrill.md
- integrations/builtin/credentials/marketstack.md
- integrations/builtin/credentials/matrix.md
- integrations/builtin/credentials/mattermost.md
- integrations/builtin/credentials/mautic.md
- integrations/builtin/credentials/medium.md
- integrations/builtin/credentials/messagebird.md
- integrations/builtin/credentials/metabase.md
- integrations/builtin/credentials/microsoft.md
- integrations/builtin/credentials/microsoftsql.md
- integrations/builtin/credentials/mindee.md
- integrations/builtin/credentials/misp.md
- integrations/builtin/credentials/mocean.md
- integrations/builtin/credentials/mondaycom.md
- integrations/builtin/credentials/mongodb.md
- integrations/builtin/credentials/monicacrm.md
- integrations/builtin/credentials/mqtt.md
- integrations/builtin/credentials/msg91.md
- integrations/builtin/credentials/mysql.md
- integrations/builtin/credentials/nasa.md
- integrations/builtin/credentials/netlify.md
- integrations/builtin/credentials/nextcloud.md
- integrations/builtin/credentials/nocodb.md
- integrations/builtin/credentials/notion.md
- integrations/builtin/credentials/odoo.md
- integrations/builtin/credentials/onesimpleapi.md
- integrations/builtin/credentials/onfleet.md
- integrations/builtin/credentials/openweathermap.md
- integrations/builtin/credentials/orbit.md
- integrations/builtin/credentials/oura.md
- integrations/builtin/credentials/paddle.md
- integrations/builtin/credentials/pagerduty.md
- integrations/builtin/credentials/paypal.md
- integrations/builtin/credentials/peekalink.md
- integrations/builtin/credentials/phantombuster.md
- integrations/builtin/credentials/philipshue.md
- integrations/builtin/credentials/pipedrive.md
- integrations/builtin/credentials/plivo.md
- integrations/builtin/credentials/postgres.md
- integrations/builtin/credentials/posthog.md
- integrations/builtin/credentials/postmark.md
- integrations/builtin/credentials/profitwell.md
- integrations/builtin/credentials/pushbullet.md
- integrations/builtin/credentials/pushcut.md
- integrations/builtin/credentials/pushover.md
- integrations/builtin/credentials/questdb.md
- integrations/builtin/credentials/quickbase.md
- integrations/builtin/credentials/quickbooks.md
- integrations/builtin/credentials/rabbitmq.md
- integrations/builtin/credentials/raindrop.md
- integrations/builtin/credentials/reddit.md
- integrations/builtin/credentials/redis.md
- integrations/builtin/credentials/rocketchat.md
- integrations/builtin/credentials/rundeck.md
- integrations/builtin/credentials/s3.md
- integrations/builtin/credentials/salesforce.md
- integrations/builtin/credentials/salesmate.md
- integrations/builtin/credentials/seatable.md
- integrations/builtin/credentials/securityscorecard.md
- integrations/builtin/credentials/segment.md
- integrations/builtin/credentials/sendemail.md
- integrations/builtin/credentials/sendgrid.md
- integrations/builtin/credentials/sendinblue.md
- integrations/builtin/credentials/sendy.md
- integrations/builtin/credentials/sentryio.md
- integrations/builtin/credentials/servicenow.md
- integrations/builtin/credentials/shopify.md
- integrations/builtin/credentials/signl4.md
- integrations/builtin/credentials/slack.md
- integrations/builtin/credentials/sms77.md
- integrations/builtin/credentials/snowflake.md
- integrations/builtin/credentials/splunk.md
- integrations/builtin/credentials/spontit.md
- integrations/builtin/credentials/spotify.md
- integrations/builtin/credentials/ssh.md
- integrations/builtin/credentials/stackby.md
- integrations/builtin/credentials/storyblok.md
- integrations/builtin/credentials/strapi.md
- integrations/builtin/credentials/strava.md
- integrations/builtin/credentials/stripe.md
- integrations/builtin/credentials/supabase.md
- integrations/builtin/credentials/surveymonkey.md
- integrations/builtin/credentials/syncromsp.md
- integrations/builtin/credentials/taiga.md
- integrations/builtin/credentials/tapfiliate.md
- integrations/builtin/credentials/telegram.md
- integrations/builtin/credentials/thehive.md
- integrations/builtin/credentials/timescaledb.md
- integrations/builtin/credentials/todoist.md
- integrations/builtin/credentials/toggl.md
- integrations/builtin/credentials/travisci.md
- integrations/builtin/credentials/trello.md
- integrations/builtin/credentials/twake.md
- integrations/builtin/credentials/twilio.md
- integrations/builtin/credentials/twist.md
- integrations/builtin/credentials/twitter.md
- integrations/builtin/credentials/typeform.md
- integrations/builtin/credentials/unleashedsoftware.md
- integrations/builtin/credentials/uplead.md
- integrations/builtin/credentials/uproc.md
- integrations/builtin/credentials/uptimerobot.md
- integrations/builtin/credentials/urlscanio.md
- integrations/builtin/credentials/vero.md
- integrations/builtin/credentials/vonage.md
- integrations/builtin/credentials/webflow.md
- integrations/builtin/credentials/wekan.md
- integrations/builtin/credentials/whatsapp.md
- integrations/builtin/credentials/wise.md
- integrations/builtin/credentials/woocommerce.md
- integrations/builtin/credentials/wordpress.md
- integrations/builtin/credentials/workable.md
- integrations/builtin/credentials/wufoo.md
- integrations/builtin/credentials/xero.md
- integrations/builtin/credentials/yourls.md
- integrations/builtin/credentials/zammad.md
- integrations/builtin/credentials/zendesk.md
- integrations/builtin/credentials/zoho.md
- integrations/builtin/credentials/zoom.md
- integrations/builtin/credentials/zulip.md
- Custom API actions for existing nodes: integrations/custom-operations.md
- Community nodes:
- integrations/community-nodes/index.md