Gmail

<< Click to Display Table of Contents >>

Navigation:  Using SyncBackPro > Technical Reference >

Gmail

 

For Gmail, you can either use application passwords, which are simpler to create but potentially less secure, or you can create a ClientID and Client Secret. It is possible that at a future date, Google will disallow application passwords.

 

Once you have a Client ID and Client Secret you can use it in the Linked Cloud Accounts so that you no longer need to enter it again.

 

We have an article online that explains in detail how to create a ClientID and Client Secret. Alternatively, the steps are explained below:

 

SyncBackPro requires four scopes:

 

.../auth/userinfo.email (a non-sensitive scope, required to see your primary Google Account email address)

.../auth/userinfo.profile (a non-sensitive scope, required to see your personal info, including any personal info you've made publicly available)

.../auth/gmail.send (a sensitive scope, required to send email on your behalf)

https://mail.google.com/ (a restricted scope, required to read, compose, send, and permanently delete all your email from Gmail)

 

Manual Steps for Creating a Client ID and Secret

 

Although it appears to be very complex, the process of creating a client ID and secret is quite simple:

 

You need to create a project using the Google API console.

Next, you enable the Gmail API for that project. You must do this before adding scopes as the scopes available depend on which API's and services have been enabled.

After that you define the scopes, which basically specify what the project is allowed to do.

You next specify which users (based on their email address) can use the project.

Before publishing, you need to create the credentials (the client ID and secret).

Finally, you publish the project so it can be used, e.g. by SyncBackPro.

 

Project

 

Go to the Google Developers Console: https://console.cloud.google.com/

Click the Select a project drop-down menu on the left side of the page. A pop-up window appears on the screen.

Click NEW PROJECT on the top-right of the pop-up window.

Enter a Project name, e.g. SyncBack Gmail, then click the CREATE button.

It may take a while for the project to be created. Once the project is created, select it from the menu at the top.

 

Scopes

 

Click the burger menu on the top-left of the window and select Enabled APIs & services.

Click + ENABLE APIS AND SERVICES at the top of the window.

Enter gmail into the search box and press Enter

Click the Gmail API box...

...then click the ENABLE button. It may take a few moments to enable it.

Once enabled, click OAuth consent screen on the left of the window.

Select the User Type as External. Click the CREATE button.

Enter an app name, e.g. SyncBack Gmail, and use your own Gmail email address for the user support email.

Scroll down and use your own Gmail email address for the developer contact. Next, click SAVE AND CONTINUE.

Click the ADD OR REMOVE SCOPES button. A new window appears on the right side of the screen.

You may need to scroll down to the Manually add scopes section.

Add https://mail.google.com under the Manually add scopes section. Click the ADD TO TABLE button.

The newly added entry is displayed on the Filter table (you may need to scroll up).

In the Filter table, tick the userinfo.email and userinfo.profile checkboxes.

In the Enter property name or value edit box, enter gmail.send and press Enter.

Tick the Gmail API checkbox then click the UPDATE button at the bottom.

You should see four scopes listed: userinfo.email and userinfo.profile in Your non-sensitive scopes, Gmail API in Your sensitive scopes, and https://mail.google.com/ in Your restricted scopes. It is critically important those four scopes are there. If not, repeat the steps above.

It all four are listed, click the SAVE AND CONTINUE button at the bottom of the window.

 

Users

 

Click + ADD USERS and enter your email address (the email address you will use in SyncBack to either email logs or backup your emails). You can add multiple email addresses. Click ADD once you've added all the email addresses.

Click SAVE AND CONTINUE.

A summary is shown. Scroll down and click the BACK TO DASHBOARD button.

 

Credentials

 

Click Credentials on the left of the window.

Click + CREATE CREDENTIALS and select OAuth client ID from the pop-up menu.

For the Application type select Desktop app

Enter a name, e.g. SyncBack Gmail, then click CREATE.

Once created (it may take a few moments) a pop-up window appears on the screen displaying the Client ID and Client secret code. You need to securely store the Client ID and Client Secret as these are used in SyncBackPro to access Gmail. Click DOWNLOAD JSON to store them in a file (which can be used by SyncBack). Once you've done that, click OK to close the pop-up window.

 

Publish

 

Click the OAuth consent screen link on the left.

Click the PUBLISH APP button.

A pop-up window appears (Push to production?). Click CONFIRM.

Congratulations! You can now use the client ID and client secret in SyncBackPro to email logs or to backup your email. IMPORTANT: DO NOT CLICK PREPARE FOR VALIDATION!

 

 

 

All Content: 2BrightSparks Pte Ltd © 2003-2024