Skip to content
This repository has been archived by the owner on Jan 11, 2025. It is now read-only.

flask module for email auths, [GMAIL authentication]

Notifications You must be signed in to change notification settings

RyuZinOh/flask-google-auth-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google OAuth Authentication with OTP Verification

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.

How does it work?

  1. Created an API service in the Google Developer Console.
  2. Implemented the API routes provided by Google in Flask.
  3. Set up SMTP mailing configuration in Gmail to verify users via OTP.

How to use this module locally?

Prerequisites

  • 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

Steps

1. Clone the repository

Clone the project to your local machine:

git clone https://github.com/your-repo/google-oauth-otp.git

2. Set up the Python environment

Create a virtual environment and activate it:

python -m venv venv
venv\Scripts\activate

Install the required dependencies:

pip install -r requirements.txt

3. Set up Google OAuth credentials

generate client tokens ids, and keys frm the services apis, frm google console

4. Set up the .env file

SECRET_KEY,
GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET,
MAIL_USERNAME,
MAIL_PASSWORD,
MONGO_URI,

5. run the application now.

python app.py

About

flask module for email auths, [GMAIL authentication]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published