Hi there, and thank you for using Dabbu CLI!
To access your Google Drive/Gmail, Google requires developers to request user consent using the OAuth 2.0 procedure. This involves obtaining a client ID and client secret from Google, which are not supposed to be revealed to anyone. However, Dabbu CLI is open source, and we cannot embed the client ID and client secret in the code. This means that users need to create their own client ID and secret and enter it in the CLI.
In case you want to use Dabbu CLI with another Google account, do NOT follow the below procedure: instead, simply leave the client ID and client secret fields blank. When the CLI asks you to authorise the app, simply choose with the new account that you want to add to Dabbu CLI.
- Create the project
- Go to https://console.cloud.google.com/cloud-resource-manager
- Click on the
CREATE PROJECT
button - Enter
Dabbu CLI
as the project name and pressCreate
- Enable the APIs required
- Once the project is created, go to the following URL: https://console.cloud.google.com/projectselector2/home/dashboard?supportedpurview=project
- Select the project that you just created.
- Click on the ≡ icon on the top left
- Click on
API & Services
- Click on the blue
ENABLE APIS AND SERVICES
button - Now search for the API you want to enable
- If you want to access your Google Drive, search for
Google drive
and click on the first result. Then press the enable button - If you want to access your Gmail, search for
Gmail
and click on the first result. Then press the enable button - If you want to access your Google Photos, search for
Google photos library
and click on the first result. Then press the enable button
- If you want to access your Google Drive, search for
- Configure the consent screen
- Once you have enabled one or more APIs that you need, click on the ≡ icon on the top left
- Hover over
API & Services
, then clickCredentials
- Click on the blue
CREATE CREDENTIALS
button - Click on
OAuth client ID
- Click on the blue
CONFIGURE CONSENT SCREEN
button - Fill in the fields as follows:
- User type:
EXTERNAL
- Then press
CREATE
- Then on the
OAuth Consent Screen
page:- App name:
Dabbu CLI
- User support email: select any one from the dropdown
- Developer contact information: enter your email address
- Then press
SAVE AND CONTINUE
- App name:
- Then on the
Scopes
page:- Press
ADD OR REMOVE SCOPES
- In the popup on the right side, scroll down to the bottom. A textbox should be there, with the text
Manually add scopes
above it. - Enter the following in that textbox:
https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/gmail.modify, https://www.googleapis.com/auth/photoslibrary
(The last one -https://www.googleapis.com/auth/photoslibrary
- can be skipped/omitted, as the Google Photos provider is planned but not yet implemented) - Click
ADD TO TABLE
- Click
UPDATE
- In the popup on the right side, scroll down to the bottom. A textbox should be there, with the text
- Then press
SAVE AND CONTINUE
- Press
- Then on the
Test users
page:- Press
Add Users
- In the popup on the right side, enter the email address for the account(s) you intend to use the app with
- Press
ADD
- Then press
SAVE AND CONTINUE
- Press
- Then on the
Summary
page:- Press the blue
BACK TO DASHBOARD
button
- Press the blue
- User type:
- Create the OAuth client
- Once you have configured the consent screen, click on the ≡ icon on the top left
- Hover over
API & Services
, then clickCredentials
- Click on the blue
CREATE CREDENTIALS
button - Click on
OAuth client ID
- Fill in the fields as follows:
- Application type:
Web application
- Name:
Dabbu CLI
- Authorized redirect URIs:
- Press
Add URI
- Enter
http://localhost:8081
and press enter
- Press
- Press the blue
CREATE
button - You should see a popup on the screen, with the title
OAuth client created
. Copy the client ID and client secret given in the popup and paste it into the CLI one by one.
- Application type:
Follow the rest of the instructions on screen to access your Google Drive from Dabbu CLI.
Thank you!