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.
- Python: Version >= 3.8.10
- Python Virtual Environments: Documentation
Install the necessary system packages:
sudo apt install build-essential python3-dev-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
. venv/bin/activate -
Install the required Python packages:
pip install -r requirements.txt
- Obtain your credentials from the Google Cloud Console.
- Set the
credentials.jsonpath of your credentials file in themanifest.ini:
[credentials]
path = ./credentials.jsonSample 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_urisis used for the OAuth2 flow.