Skip to content

Jawad2011/How-to-get-Google-credential-for-n8n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”‘ How to Get Google Credentials for n8n

Status Category Tool Platform License

⚠️ Disclaimer: This guide is for educational and personal learning purposes only. It is not intended for business or commercial use.

Connect Google Cloud to n8n once and reuse the credential across Google Sheets, Gmail, Drive, and more. The process is slightly involved β€” but this guide breaks it down into clear, numbered steps.


πŸ“‹ Overview

Phase Steps What You'll Do
Google Cloud 1–18 Create a project and configure OAuth
n8n 19–21 Create the credential and grab the redirect URL
Back to Google Cloud 22–23 Add redirect URLs and generate Client ID & Secret
Finish in n8n 24–32 Paste credentials, add test users, and connect

☁️ Phase 1 β€” Google Cloud Console Setup

Step 1 β€” Search for Google Cloud Console

Search "Google Cloud Console" in your browser.

Step 2 β€” Open the Console

Click on the official Google Cloud Console link from the search results.

Image

Step 3 β€” Open the Project Selector

Click the project selector dropdown at the top of the page.

Image

Step 4 β€” Create a New Project

Click "New Project" from the project selector panel.

Image

Step 5 β€” Name Your Project

Enter any name you like for your project.

Image

Step 6 β€” Click "Create"

Hit the Create button to finish creating your project.

Image

Step 7 β€” Select Your New Project

Open the project selector again and select the project you just created.

Image

Step 8 β€” Open the Navigation Menu

Click the three-line (hamburger) icon in the upper-left corner.

Image

Step 9 β€” Go to OAuth Consent Screen

Navigate to APIs & Services β†’ OAuth consent screen.

Image

Step 10 β€” Start Configuration

Click the button to begin setting up the consent screen.

Image

Step 11 β€” Fill in App Details

Fill in the required fields:

  • App name: n8n
  • Support email: your personal Gmail address (recommended)
Image

Step 12 β€” Select "External" User Type

Choose External so you can authorize your own Google account to use the app.

Image

Step 13 β€” Add a Contact Email

Enter an email address for developer contact. You can reuse the same address from Step 11. Multiple emails are allowed.

Image

Step 14 β€” Accept the Terms

Check the checkbox to agree to Google's API terms.

Image

Step 15 β€” Submit

Click Submit to save your consent screen configuration.

Image

You'll land on this confirmation screen:

Image

Step 16 β€” Create OAuth Client

Click "Create OAuth Client" to proceed.

Image

Step 17 β€” Set Application Type

From the Application type dropdown, select Web application.

Image

Step 18 β€” Name the OAuth Client

Enter any name you like (e.g. n8n OAuth Client). Don't click Create yet β€” you need the redirect URL from n8n first.

Image

βš™οΈ Phase 2 β€” n8n Credential Setup

Step 19 β€” Create a Credential in n8n

Log into n8n, go to Credentials, and click "Create credential".

Image

Step 20 β€” Search for Google OAuth2 API

Type "Google OAuth2 API" in the search bar and select it.

Image

Step 21 β€” Click "Continue"

Image

You'll see this page β€” pay close attention here, this is where most people get confused:

Image

There are 3 important fields on this screen:

Field What It Is
Redirect URL Auto-generated by n8n. Format: https://yourdomain.com/rest/oauth2-credential/callback
Client ID Generated in Google Cloud after creating the OAuth client
Client Secret Generated in Google Cloud after creating the OAuth client

πŸ”— Phase 3 β€” Link n8n Redirect URL in Google Cloud

Step 22 β€” Add Authorized Redirect URIs

Back in Google Cloud, scroll to Authorized redirect URIs and fill in two boxes:

  • Box 1 (Authorized JavaScript origins): paste only the domain part β€” https://yourdomain.com or https://yourdomain.com:PORT if a port is shown in your n8n redirect URL
  • Box 2 (Authorized redirect URIs): paste the full redirect URL from n8n exactly as shown

πŸ’‘ Note: example.com is used as a placeholder. Replace it with your actual n8n domain. Be careful not to include /rest/oauth2-credential/callback in Box 1.

Image

Step 23 β€” Click "Create"

Click Create to generate your Client ID and Client Secret. Save both β€” you'll need them in the next step.

Image

βœ… Phase 4 β€” Complete Setup in n8n

Step 24 β€” Paste Client ID and Client Secret

Go back to n8n and paste your Client ID and Client Secret into their respective fields.

Image

Step 25 β€” Go to the Audience Tab

Back in Google Cloud, click on the "Audience" tab.

Image

Step 26 β€” Add Test Users

Scroll down and click "Add users".

Image

Step 27 β€” Enter Gmail Accounts

Add the Gmail accounts you'll use to access Google services through n8n. You can add up to 100 accounts. All addresses must end in @gmail.com.

Image

Step 28 β€” Save the Test Users

Type each email, press Enter, then click Save.

Image

If your email appears in the list, it was saved successfully βœ…

Image

Step 29 β€” Add the Required API Scope

Enter the API scope URL for the Google service you want to connect. Common examples:

https://mail.google.com/
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com
Image

Sign in using the Gmail account you added as a test user in Step 27.

Step 30 β€” Sign in with Google in n8n

Back in n8n, scroll down and click "Sign in with Google".

Image

Step 32 β€” Continue signing in.

N.B. The acount that you will use to sign into n8n must remain signed in your device. If it is not, then you have to first sign in the acoount into your device first.

Step 32 β€” Bypass the "Unverified App" Warning

You may see a warning screen. This is expected for apps in testing mode β€” just click "Continue".

Step 33 β€” Grant All Permissions

When prompted, check "Select all" to grant the necessary permissions, then continue.

Image

πŸŽ‰ You're Connected!

Once you sign in, n8n will automatically test the connection. A successful test means your Google credential is live and ready to use.

πŸ“ Note: This guide uses Gmail as the example, but the exact same steps apply to Google Sheets, Drive, Calendar, and all other Google services.

You only need to do this once. After that, you can reuse this credential across all your n8n workflows.


❓ Questions & Support

Got stuck? Open a GitHub Discussion β€” I'll do my best to help.

If this guide saved you time, please give it a ⭐ to help others find it!


Built by Jawad Β· Educational use only Β· Open source

About

It is just a tutorial on how to get credential for n8n from Google Cloud Console

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors