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
Step 3:
Click here.
Step 4:
Click “new project” from here.
Step 5:
choose any name and type it here
Step 6:
Now click “Create”
Step 7:
Select the project you created.
Step 8:
Click on this three line icon on the upper left side.
Step 9:
select “OAuth consent screen”
Step 10:
Click here.
Step 11: Fill the details
Step 12:
Select “External”
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.
Step 14:
Mark it
Step 15:
Click “Submit”
After you submit, you will see ths screen:
Step 16:
click “Create OAuth client”
Step 17:
Select “Web application” from “Application type”
Step 18:
Type any name you want
At this stage, We need to go to n8n.
Step 19:
Log into your n8n and select credentials. Then, click on “Create credential”
Step 20:
Now type “Google OAuth2 API” and select “Google OAuth2 API”
Step 21:
Click “Continue”
After that you will stumble upon this page:
In this part, you must focus. Everyone gets confused at this stage.
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.
Client ID: This will be generated after creating “OAuth Client ID”
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.
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”
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.
Step 25:
Click on “Audience”
Step 26:
Scroll down and click on “Add users”
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
Step 28:
Type the e-mails and press enter. After that click on “Save”
If your e-mail shows up here. That means your e-mail has been saved propely.
Step 29:
Go to your n8n and scroll down. Then, click on “Sign in with Google”
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”
Step 31: At one stage, you will get this option. Just checkmark “Select all”
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!