Skip to content

Google: OAuth2 generic#

This document contains instructions for creating a generic OAuth2 Google credential for use with custom operations.


Set up OAuth#

Create a new credential in n8n#

  1. Follow the steps to Create a credential. 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 create a credential for a custom API call, 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.

    View screenshot

    OAuth Callback URL

  3. You must provide the scopes for this credential. Refer to Scopes for more information.

Set up OAuth in Google Cloud#

  1. Go to Google Cloud Console and make sure you're in the project you want to use.

    View screenshot

    Google project dropdown

  2. Select + CREATE CREDENTIALS > OAuth client ID. .

    View screenshot

    Create credentials

  3. In the Application type dropdown, select Web application. Google automatically generates a name.

  4. Under Authorizes redirect URIs, select + ADD URI. Paste in the OAuth redirect URL from the previous step.

    View screenshot

    Web application

  5. Select CREATE.

  6. Enable each Google service API that you want to use:

    1. Access your Google Cloud Console - Library. Make sure you're in the correct project.
    2. Search for and select the API(s) you want to enable. For example, for the Gmail node, search for and enable the Gmail API. /// note | Some integrations need additional APIs The following integrations require the Google Drive API, as well as their own API:

      • Google Docs
      • Google Sheets
      • Google Slides ///
    3. Select ENABLE.

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:


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 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.

Supported scopes
Service Available scopes
Google Ads
Google Analytics
Google Big Query
Google Books
Google Calendar
Google Cloud Natural Language
Google Cloud Storage
Google Contacts
Google Docs
Google Drive
Google Firebase Cloud Firestore
Google Firebase Realtime Database
Google Perspective
Google Sheets
Google Slide
Google Tasks
Google Translate
GSuite Admin


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.

If you need to use credentials generated by another account (by a developer or another third party), follow the instructions in Google Cloud documentation | Authorization errors: Google hasn't verified this app.