Skip to content

smswithoutborders/gmail-oauth2-adapter

Repository files navigation

Gmail OAuth2 Platform Adapter

This adapter provides a pluggable implementation for integrating Gmail as a messaging platform. It is designed to work with RelaySMS Publisher, enabling users to connect to Gmail using OAuth2 authentication.

Requirements

Dependencies

On Ubuntu

Install the necessary system packages:

sudo apt install build-essential python3-dev

Installation

  1. Create a virtual environment:

    python3 -m venv venv
  2. Activate the virtual environment:

    . venv/bin/activate
  3. Install the required Python packages:

    pip install -r requirements.txt

Configuration

  1. Obtain your credentials from the Google Cloud Console.
  2. Set the credentials.json path of your credentials file in the manifest.ini:
   [credentials]
   path = ./credentials.json

Sample credentials.json

{
  "web": {
    "client_id": "",
    "project_id": "",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "",
    "redirect_uris": ["http://localhost/callback/"],
    "javascript_origins": ["http://localhost"]
  }
}

Only the first item in the redirect_uris is used for the OAuth2 flow.

About

Pluggable Gmail OAuth2 adapter for RelaySMS Publisher.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages