JDBC Driver for Gmail

Build 23.0.8839

Creating a Custom OAuth App

OAuth custom applications are required for desktop applications, web applications, and headless machines.

Enable the Gmail API

Follow these steps to enable the Gmail API:

  1. Navigate to the Google Cloud Console.
  2. Select Library from the left-hand navigation menu. This opens the Library page.
  3. In the search field, enter "Gmail API" and select Gmail API from the search results.
  4. On the Gmail API page, click ENABLE.

Create an OAuth App for User Account Authentication

Follow the procedure below to register an app and obtain the OAuthClientId and OAuthClientSecret.

Desktop Applications

Follow the steps below to obtain the OAuthClientId, OAuthClientSecret.

  1. Log into the Google API Console.
  2. Click Create Project or select an existing project.
  3. In the API Manager, select Credentials > Create Credentials > OAuth Client Id.
  4. Select the application type. If you are making a desktop application, select Other.
  5. Create a consent screen if there are none available in your selected organization. A caveat: If you are not using a Google Workspace account, you are restricted to creating an External-type Consent Screen, which requires specifying a support email and developer contact email. Additional info is optional.
  6. Click Create. The OAuthClientId and OAuthClientSecret are displayed.
  7. Select Library > Gmail API > Enable API. >

Web Applications

Follow the steps below to obtain the OAuthClientId and OAuthClientSecret.

  1. Log into the Google API Console.
  2. Click Create Project or select an existing project.
  3. In the API Manager, select Credentials > Create Credentials > OAuth Client Id.
  4. Select the web application type. In Authorized Redirect URIs, enter the URL you want to be used as a trusted redirect URL, where the user returns with the token that verifies that they have granted your app access.
  5. Click Create. The OAuthClientId and OAuthClientSecret are displayed.
  6. Select Library > Gmail API > Enable API.

Headless Machines

Follow the steps below to obtain the OAuthClientId and OAuthClientSecret.

  1. Log into the Google API Console.
  2. Click Create Project or select an existing project.
  3. In the API Manager, select Credentials > Create Credentials > OAuth Client Id.
  4. Select the application type. If you are creating a desktop application, select Other.
  5. Click Create. The OAuthClientId and OAuthClientSecret are displayed.
  6. Select Library > Gmail API > Enable API.

Create an OAuth App for Service Account Authentication

Follow the steps below to create an OAuth application and create a private key:

  1. Log into the Google API Console.
  2. Click Create Project or select an existing project.
  3. In the API Manager, select Credentials > Create Credentials > Service Account Key. In the Service Account menu, select New Service Account or select an existing service account. In the "Key Type" section, select the P12 key type.
  4. Click Create. The key pair is downloaded and the private key's password is displayed.
  5. Select Library > Gmail API > Enable API.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839