This is a module to test and verify Google authentication for web applications, ensuring that only Gmail-confirmed accounts are able to authenticate and access services. This way, any random email addresses won't be verified without proper Gmail confirmation.
- Created an API service in the Google Developer Console.
- Implemented the API routes provided by Google in Flask.
- Set up SMTP mailing configuration in Gmail to verify users via OTP.
- Python 3.x
- A Gmail account (for sending OTP emails via Gmail's SMTP server)
- MongoDB installed locally or on a cloud provider like MongoDB Atlas
- A Google Developer Console project to generate OAuth 2.0 credentials
Clone the project to your local machine:
git clone https://github.com/your-repo/google-oauth-otp.git
Create a virtual environment and activate it:
python -m venv venv
venv\Scripts\activate
Install the required dependencies:
pip install -r requirements.txt
generate client tokens ids, and keys frm the services apis, frm google console
SECRET_KEY,
GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET,
MAIL_USERNAME,
MAIL_PASSWORD,
MONGO_URI,
python app.py