> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pads4.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google

<Warning>
  This article requires you to have at least PADS4 version 2025.2.
</Warning>

This document provides step-by-step instructions for creating OAuth2 credentials for SMTP authentication using Google and Microsoft platforms. This document assumes the reader has basic familiarity with the Google Cloud Platform.

## **1. Create a Google Cloud Project**

* Navigate to the Google Cloud Console: [https://console.cloud.google.com/](https://console.cloud.google.com/)
* Click on the project dropdown at the top of the page and select ‘\*\*Select a Project’ \*\*and then Click on the **‘New Project’.**
  * **Project name**: Enter a descriptive name for your project
  * **Location**: Select the appropriate location or leave as default

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp1.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=35de28cde682f41785d30366ccbf68ec" alt="Google Smtp1" width="888" height="401" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp1.png" />

* Click **Create** to create your project

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp2.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=5cc7978635a839afac9b26e3ce8caead" alt="Google Smtp2" width="888" height="495" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp2.png" />

## **2. Enable Gmail API**

* In your newly created project, go to **API's & Services > Library**
* Search for "Gmail API" in the search bar

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp3.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=a20c3d2636c98076d537ebd0fd246021" alt="Google Smtp3" width="888" height="387" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp3.png" />

* Click on **Gmail API** from the results
* Click on **Enable** button to enable the Gmail API for your project

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp4.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=552c36b26e894ad87eb40ef5167504d5" alt="Google Smtp4" width="888" height="329" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp4.png" />

## **3. Configure Oauth Consent Screen**

* Navigate to **API's & Services > OAuth consent screen**

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp5.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=f3722d62de6c7b2f37252eb3504ecf57" alt="Google Smtp5" width="888" height="435" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp5.png" />

* Click **Get started**
* Fill in the required app information
  * Appname: Name of your application e.g **PADS4**
  * User support email: Select your email address
  * Developer contact information: Enter your email address

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp6.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=db9dc0384e7d9d732912c235530a82c2" alt="Google Smtp6" width="888" height="463" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp6.png" />

* Select the user type
  * Internal: For Google Workspace users only ( recommended if applicable )
  * External: For any Google account user
* Click **Save and continue**

## **4. Create OAuth2 Credentials**

* Go to **API's & Services > Clients**

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp7.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=83f95697ad552828bd16901a6b6e0a12" alt="Google Smtp7" width="888" height="414" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp7.png" />

* Click on **Create client**
* Select **Web application** as the application type ( Web application )
* Enter a name for your OAuth client

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp8.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=58c4cba5736fca97d3387f820648240c" alt="Google Smtp8" width="888" height="400" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp8.png" />

* Under **Autherized redirect URI's**, click \*\*Add URI \*\*and enter:
  * http\://\<host>:\<port>/credentials/generic/authorize/callback
    * **Host:** DNS name or IP address of your PADS4 Web Portal
    * **Port:** Optional, if the PADS4 Web Portal is not using the default ports for HTTP or HTTPS, you should specify the port number.

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp9.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=0c340ac1b2eb2267ddc308ef3b535739" alt="Google Smtp9" width="888" height="454" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp9.png" />

* Click on **create**
* A dialog will appear with your**client ID**  and **client secret**.  Copy or download these values and store them securely as you will need the for the PADS4 configuration

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Google-smtp10.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=61f14ddc629c2bf49501019c29f82fbf" alt="Google Smtp10" width="710" height="330" data-path="images/ctrl-centre/administration/smtp-oauth2/Google-smtp10.png" />

## **5. Configuration in PADS4**

To begin:

* Open your **web browser**.
* Navigate to the **PADS4 server URL** (either a DNS name or IP address).
* Log in using an **Administrator account**.

Once logged in:

* Click on **Dashboard**.
* Use the **Toggle Sidebar** button at the **top-right** of the screen.
* Navigate to **Credentials**.
* Then select **Providers**.
* Click on **New**

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/SMTP-Oauth2White.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=1425c7b6de06466da48fb987d9093f70" alt="SMTP Oauth2white" width="617" height="488" data-path="images/ctrl-centre/administration/smtp-oauth2/SMTP-Oauth2White.png" />

* Select **SMTPOAuth2**

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/SMTP-Oath2W.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=6b53149cb07f4abbaa325cc7792677dd" alt="SMTP Oath2w" width="452" height="505" data-path="images/ctrl-centre/administration/smtp-oauth2/SMTP-Oath2W.png" />

* Fill in the information as follows:
  * **App name:** Represent the name of your provider in PADS4 (can be any value)
  * **SMTP Provider:** Google
  * **App (client) ID:** Retrieved from Google Cloud Console described in step 4
  * **Client Secret:** Retrieved from Google Cloud Console described in step 4
* Click on **create**
* Now go to the overview page and select the SMTP provider that you have just configured.
* Click connect, choose your user account and grant the request access.

<img src="https://mintcdn.com/pads4/KYWdP9NvEcz9ns1X/images/ctrl-centre/administration/smtp-oauth2/Provider-overview.png?fit=max&auto=format&n=KYWdP9NvEcz9ns1X&q=85&s=8994c237a58079e75fc4031a874fcb21" alt="Provider Overview" width="888" height="417" data-path="images/ctrl-centre/administration/smtp-oauth2/Provider-overview.png" />

## How to use this set up in the SMTP configuration.

Once logged in:

* Click on **Home**.
* Use the **Toggle Sidebar** button at the **top-left** of the screen.
* Navigate to **Config**.
* Then press **Edit**

<img src="https://mintcdn.com/pads4/vw4NTIWzbMxhQxAY/images/ctrl-centre/administration/config/smtp-oauth.png?fit=max&auto=format&n=vw4NTIWzbMxhQxAY&q=85&s=d62db0c4f027ffe4c86bf0ac8ed127c6" alt="Smtp Oauth" width="746" height="1090" data-path="images/ctrl-centre/administration/config/smtp-oauth.png" />
