Skip to main content

How-to use Google Sheets with Oauth2 Credentials

Oauth2 authentication is a method to authenticate Google Sheets flows, you can use your main account with this method.

The following steps generate a Service Account for Google Sheets API.

  1. Go to https://console.developers.google.com/

  2. Select or create a new project. You have to create one if you don't have a project.

Google Console

  1. Open the menu and click APIs & Services -> Library.

Google Library

  1. Search for Google Sheets API.

Search Google Sheets

note

If you want to use Google Sheets package, you can use this Credentials for all the Google Sheets nodes except the "Create Spreadsheet" node. This node may need a Google Drive API in some cases like sharing the spreadsheet. By following the same steps for Google Drive API and you can use same credentials for Google Drive automation too.

  1. After clicking Google Sheets API in the search results, Google Sheets API's homepage will be opened. Click the "ENABLE" button on the page.

Enable Google Sheets API

  1. After enabling the API, it will redirect you to the overview page of Google Sheets API.

Google Sheets Overview

  1. Go to APIs & Services > OAuth consent screen and start to configure your application.

Menu

  1. Select user type of your application then click Create.

User Type

note

If you are not a Google Workspace user, you must select external in this step.

  1. If user type of your application is external then you need to add your main account as a test user by clicking "ADD USERS" button.

Add Users

  1. Fill out the app information form (App name, User support email and contact information is required) then click "SAVE AND CONTINUE" button.

  2. You can just pass Scopes screen by clicking "SAVE AND CONTINUE" button. If your app's user type is external then you may need to add yourself as a test user in Test users screen.

Scopes

  1. Click the "Credentials".

Credentials

  1. In this screen click "CREATE CREDENTIALS" then select OAuth client ID.

Create Credentials

  1. Select Desktop app then click "CREATE".

Create

  1. A pop-up will appear click "DOWNLOAD JSON".

Download Json

  1. Create a vault item (as document item) and copy the content of downloaded json file to this vault item. For more information about creating vault items see here.

Vault Item