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

Status Category Tool Platform License

Disclaimer: This is for educational/learning purposes only. It cannot be used for business purposes.

Hello, all. In this repo, we will know how to get Google credentials from Google cloud console for n8n. You will set up only once and can use it multiple times in n8n. This process is slightly complex but I will try to break it down step-by-step. So, let’s start:

Step 1: Search “Google Cloud Console”

Step 2: Click on the link shown here Image

Step 3: Click here. Image

Step 4: Click “new project” from here. Image

Step 5: choose any name and type it here Image

Step 6: Now click “Create” Image

Step 7: Select the project you created. Image

Step 8: Click on this three line icon on the upper left side. Image

Step 9: select “OAuth consent screen” Image

Step 10: Click here. Image

Step 11: Fill the details

  1. Name it “n8n”
  2. put the e-mail where Google will contact with you. It is recommended that you use your own g-mail account Image

Step 12: Select “External” Image

Step 13: Put an E-mail address. You may use the e-mail address given to the step 11. You can add more than one e-mails too. Image

Step 14: Mark it Image

Step 15: Click “Submit” Image

After you submit, you will see ths screen: Image

Step 16: click “Create OAuth client” Image

Step 17: Select “Web application” from “Application type” Image

Step 18: Type any name you want Image

At this stage, We need to go to n8n.

Step 19: Log into your n8n and select credentials. Then, click on “Create credential” Image

Step 20: Now type “Google OAuth2 API” and select “Google OAuth2 API” Image

Step 21: Click “Continue” Image

After that you will stumble upon this page: Image

In this part, you must focus. Everyone gets confused at this stage.

  1. Redirect URL: you will use this URL. This URL will be in https://example.com/rest/oauth2-credential/callback format. Here example.com is the name of the domain. You must understand it because You will need it to generate “Client ID” and “Client Secret” using this link.

  2. Client ID: This will be generated after creating “OAuth Client ID”

  3. Client Secret: This will be generated after creating “OAuth Client ID”

Step 22: In the box number 1 you will put only https://example.com or https://example.com:xxxx (if the port is mentioned in the link given by n8n)

In the box number 2 you will just copy and paste the link.

Image

Note: example.com is not a real domain. You will just paste the part before /rest/oauth2-credential/callback in the box number 1. You must be exttra careful in this area.

Step 23: Click “Create” Image

After that your “Client ID” and “Client secret” will be generated. Save that “Client ID” and Client secret” for future purposes. Now we need to go back to Google Cloud Console.

Step 24: Copy and paster your “Client ID” and “Client secret” into their boxes in n8n. Image

Step 25: Click on “Audience” Image

Step 26: Scroll down and click on “Add users” Image

Step 27: In this box, type the e-mail accounts that you will use to access Google services in n8n. You can add upto 100 e-mail accounts. the e-mail accounts must end with @gmail Image

Step 28: Type the e-mails and press enter. After that click on “Save” Image

If your e-mail shows up here. That means your e-mail has been saved propely. Image

Step 29: Go to your n8n and scroll down. Then, click on “Sign in with Google” Image

Then, sign in with the account that you given as the test user in step 27.

Step 30: During signing in, you will see something like below. That is not a problem. Just click “Continue” Image

Step 31: At one stage, you will get this option. Just checkmark “Select all”

Image

After signing in, n8n will test your connection and if they that the connection is okay, that means you succesfully connected n8n and google credential. You can later use this credential to use other Google services.

N.B. In this tutorial, I used G-mail but everything is also same in other services.

If you have any question, just ask on discussions. I tried to simplify this process as much as I can. If this guide helped you, please give it a ⭐ to help others find it!