How to Use Gmail OAuth for Authentication

How to Use Gmail OAuth for Authentication

OAuth (Open Authorization) is a protocol that allows users to grant third-party applications limited access to their resources without sharing their passwords. Gmail OAuth is commonly used to authenticate and access Gmail accounts securely. This guide will walk you through the steps to use your Gmail OAuth for authentication in whitelabel tracking software

Prerequisites
Before you start, ensure you have:

  1. An active Google account.
  2. A project set up in the Google Cloud Console.
  3. A whitelabel Tracking Account

Step-by-Step Guide
1. Create a Project in Google Cloud Console

  1. Visit Google Cloud Console: Go to Google Cloud Console.
  2. Create a New Project: Click on the project drop-down at the top and select "New Project." Give your project a name and click "Create."
 

iii. Enable Gmail API: Navigate to "APIs & Services" > "Library." Search for "Gmail API" and click "Enable."





  1. Go to OAuth Consent Screen: Under "APIs & Services," click "OAuth consent screen."
  2. Configure Consent Screen: Choose "External" and click "Create." Fill in the required fields such as App name, User support email, and Developer contact information.

       iii.  Scopes: Add the scopes required for your application. For Gmail, you might need scopes like:
                 https://www.googleapis.com/auth/gmail.readonly or 

      iv. Save and Continue: Follow the prompts and save the changes.

3. Create OAuth Credentials

  1. Navigate to Credentials: Go to "APIs & Services" > "Credentials."
  2. Create Credentials: Click "Create Credentials" and select "OAuth 2.0 Client IDs.
  3. Configure OAuth Client: Choose the application type (e.g., Web application), provide a name, and specify the authorized redirect URIs. These URIs are where users will be redirected after authentication.


  iv. Get Client ID and Client Secret: After creating, you'll receive a Client ID and Client Secret. Note these down as you'll need them for the SMTP Settings setup on the application



4.  Save your Client ID and Client secret on the EMAIL SMTP SETTINGS 
  1. Grant Access by connecting to your account: You will be prompted to grant access to your Gmail account.
  2. Access Gmail Data: Once authenticated, the application will be able to access Gmail data based on the scopes you defined.
  3. Run a test by sending a TEST EMAIL


CONCLUSION
Should you encounter any issues or need further assistance, refer to the Google API Documentation or reach out to the Google support team.

    • Related Articles

    • Use your own domain name

      note: free trial accounts cannot change the domain name Once you have configured your domain name, contact us to create your HTTPS certificate - once this is created you can proceed to update your account Step 1. Create your domain name First you ...
    • The user already exists - how to use the same email address for different logins

      You've tried to add a user account, but the platform gave you an error message saying the user already exists: "The user already exists" This happens when the email address already exists on the WLT platform, it might have already been used by ...
    • The user already exists - how to use the same email address for different logins

      You've tried to add a user account, but the platform gave you an error message saying the user already exists: "The user already exists" This happens when the email address already exists on the WLT platform, it might have already been used by ...
    • Add your SMTP/email sending address

      To enable email alerts and scheduled reports on the system you must input SMTP settings for an email account. You can do this in the Reseller SMTP settings section in the admin panel. Click on ADMIN, and then navigate to RESELLER SETTINGS. Under ...
    • Server Ip and ports

      Where do I point my trackers? First read the overview of pointing devices to the platform You will need 2 settings to point a tracker to our servers Port - look up the port for my device Server address - data.gpsiot.net Port Each manufacturer has a ...