How to set up Google OAuth for G Suite? And how to configure Google OAuth credentials in WSDesk?

Google APIs use the OAuth protocol for accessing Gmail credentials and data privately. This is generally used for logging in to a third-party service or application using your existing Gmail account.

The Google OAuth can be set up for both G Suite as well as your personal Gmail account. If you have a personal Gmail account, you should read setting up Google OAuth for WSDesk article.

In this article, I’ll show you how to set up Google OAuth for your G Suite account and how you can set up Google OAuth settings in WSDesk.

Let’s get started.

How to set up Google OAuth for G Suite?

Follow the below steps for setting up Google OAuth for your G Suite account.

  • Log in to your Google API console account. Make sure you log in with your G Suite administrator account.

Creating a Project

  • Once you have logged in to your account, click on Select Project button on the top menu bar. Select your organization and click on the New Project button, as shown in the below screenshot.
WSDesk Google OAuth | Select Project

Select Project

  • In the next step, enter the desired project name and choose a location and click Create to proceed further.

A sample screenshot of the settings is shown below.

WSDesk Google OAuth | New Project

New Project

  • The project will be created with a project ID as shown in the below screenshot.
WSDesk Google OAuth | Opening my project

Opening my project

Select your project and click Open.

Enabling Gmail API

  • Next, search for Gmail API in the search console of the dashboard. Make sure you have selected your project from the project drop-down list.
WSDesk Google OAuth | Selecting Gmail API

Selecting Gmail API

Once the Gmail API is found click on the search result to proceed.

  • Click on the Enable button to enable the Gmail API for your project.
WSDesk Google OAuth | Enabling Gmail API

Enabling Gmail API

Creating Credentials

  • Click on Create credentials button to create Google OAuth credentials for your G Suite account.
WSDesk Google OAuth | Create credentials

Create credentials

  • You are then taken to the Credentials settings where you need to first set up the OAuth consent screen.
  • Click on OAuth consent screen tab and configure the credentials like selecting your G Suite administrator email address, entering your project name, homepage URL among other details. Finally, save the details.

A sample screenshot of the settings is shown below.

WSDesk Google OAuth | OAuth consent screen

OAuth consent screen

  • Next, move to the Credentials tab. Click on Create Credentials drop-down and click on OAuth client ID, as shown in the screenshot below.
WSDesk Google OAuth | Creating Credentials

Creating Credentials

Adding Credentials

  • To add credentials to your project, select the API as Gmail API and the Web server as the calling option. Additionally, choose the User Data option to access and proceed further.
WSDesk Google OAuth | Adding credentials to your project

Adding credentials to your project

  • In the next step, choose the Application type as Web Application and enter your site name. Enter the Javascript origin as your homepage URL, enter the WSDesk email settings path and click Create.

Accessing WSDesk Email setting path: The WSDesk Email settings can be found in WordPress menu > WSDesk > E-Mail. Take a look at the sample screenshot of my demo site for the WSDesk Email settings path.

WSDesk Google OAuth | WSDesk Email settings path

WSDesk Email settings path

  • Finally, your OAuth Client credentials are generated. Click on the edit icon to view your OAuth Client ID and Client Secret, as shown in the screenshot below.
WSDesk Google OAuth | OAuth Client ID and Client Secret

OAuth Client ID and Client Secret

Now that you have your Google OAuth Client credentials, let us enter this data in WSDesk.

How to configure Google OAuth credentials in WSDesk?

  • Go to WSDesk > E-Mail > Google OAuth Setup (Incoming) settings.
  • Enter your Google API Client ID, Client secret, and click on Activate OAuth button, as shown in the below screenshot.
WSDesk Google OAuth | Activate OAuth in WSDesk

Activate OAuth in WSDesk

  • In the next step, you are taken to a Gmail authorization window (shown below) where you need to enter an email address from where the emails are fetched or are redirected to. Remember, you should enter your organization’s support email address (say support@mysitename.com) and not your G Suite administrator email address.
WSDesk Google OAuth | Support email sign-in

Support email sign-in

Note: After logging in, for some application, Google does not recognize whether the site is safe or not and throws an error that the application is not verified. Hence in such case, click on the Advanced option and click Go to mysitename.com (unsafe).
A sample screenshot is shown below.
  • In the next window, click Allow to allow the app to access your Gmail data.
WSDesk Google OAuth | Allow app to access Gmail data

Allow the app to access Gmail data

  • If the above steps are successful, the Google OAuth will be activated and you will see the access tokens appear in the WSDesk setting, as shown in the screenshot below.
WSDesk Google OAuth | Google OAuth activated in WSDesk

Google OAuth activated in WSDesk

Hence in this way, you can set up Google OAuth for G Suite and configure the respective OAuth credentials in WSDesk.

For personal Gmail account setup of Google OAuth, read Setting up Google OAuth for WSDesk.

 


To explore more details about the plugins, go check out WSDesk – WordPress Helpdesk Plugin.

Read the product setting up article to understand the plugin, in detail. Or check out the product documentation section for more related articles.

You can also check out other WordPress and WooCommerce plugins in ELEX.

    Leave a Reply