Setup
Connect to your Google Sheets app for OAuth.
Pre-requisites
- Google Cloud Developer Console.
- Required Settings for the App. You can find it in Overview.
Creating an app in Google Sheets
To create a Google Sheets app and aquire the above mentioned credentials, please follow the steps mentioned below:
- Log in to your Google Cloud Console dashboard.
- Click on the
Create Project
button in the top right.
- Enter the Project Name for your application, select Organization and Location.
- In the Google Cloud Console dashboard, navigate to
APIs and services
>Credentials
in the left side menu.
Ensure that the correct app is selected by checking the name of the app in the dropdown in the top navigation bar.
- Go to your
Apps catalog
in Cobalt > Search forGoogle Sheets
>Settings
>Use your credentials
>Callback Url
> Copy it. - Click on
+ Create Credentials
button in the top in the Cloud Console app and selectOAuth client ID
.
Note: You will need to configure Google’s consent screen for access to Client ID and Client Secret if not done previously.
- Select
Web application
from the Application type dropdown > scroll toAuthorized redirect URIs
section > Click+ Add URI
button > Paste the Callback Url > ClickCreate
button in the bottom. - Navigate to
OAuth consent screen
in the left menu underAPIs and services
> Click on theEdit App
button > Scroll down > ClickSave and Continue
in the OAuth consent screen section > ClickAdd or Remove Scopes
button in the Scopes section. - Enter the mandatory scopes under
Manually add scopes
> Click onAdd To Table
> Click onUpdate
> Click onSave and Continue
at the bottom of the page.
- Go to
Enabled APIs and services
in the left menu under APIs and services > Click on+ Enable APIs and Services
> Search forGoogle Sheets API
andGoogle Drive API
> Click onEnable
for both.
- Navigate to
Credentials
in the left menu underAPIs and services
and select the Web Client underOAuth 2.0 Client IDs
. Copy the Client ID and Client Secret underAdditional information
section.
Configuring credentials in Cobalt
App settings page lets you configure the authentication settings for an OAuth2
based application. For your customers to provide you authorization to access their data,
they would first need to install your application. This page lets you set up your application credentials.
Cobalt lets you use pre-configured applications to play around. You can do so by selecting Use our credentials
. However, if you wish to use your own application,
select Use your own credentials
. Provide the aquired Client Id and Client secret and save it.
Configuring Scopes
Cobalt lets you configure what permissions to ask from your users while they install your application. The scopes can be added or removed from the App settings page, under Permissions & Scopes
section.
For some applications Cobalt sets mandatory scopes which cannot be removed. Additional scopes can be selected from the drop down. Cobalt also has the provision to add any custom scopes supported by the respective platform.
Once the scopes has been added to the project in Cobalt, go to your Google Cloud Console dashboard and update the scopes as added on Cobalt.
Navigate to Cloud Console dashboard
> Select the Project created for Cobalt > Follow the steps 8 and 9 mentioned above for adding scopes.
If you are facing scopes missing or invalid scope error. Make sure you are not passing any custom scope not supported by the platform. And, the scopes selected here are identical to the ones selected in the platform.
App Review for Google Sheets
Projects configured with a publishing status of In production
are available to any user with a Google Account. Projects configured with a publishing status of In production should complete the verification process, including defining scopes actively requested by your project’s OAuth clients, if it meets one or more of the OAuth verification criteria.
To submit app for review
- In the Project, go to
OAuth consent screen
in the left menu under APIs and services > Choose the App type asExternal
and click onPublish App
button. - Click on
Prepare for Verification
and provide the required information. - You will be required to submit justification for the scopes requested and a demo video on YouTube which shows the scopes being used.
Learn more about publishing apps in Google Cloud Console here.