Giter Site home page Giter Site logo

flask-google-auth's Introduction

Flask OAuth2 Authentication with Google OAuth2 OpenID Connect

This project demonstrates how to set up OAuth2 authentication with Google OAuth2 OpenID Connect in a Flask web application.

Getting Started

If you are cloning this repository, follow these steps to set up your project environment:

Prerequisites

Before you begin, make sure you have the following prerequisites:

  • Python installed (version 3.6 or higher)
  • Pip (Python package manager) installed
  • Git (optional, for cloning the repository)

Installation

Clone the repository (if you haven't already):

git clone https://github.com/yourusername/your-repo.git

Create a virtual environment (optional but recommended):

python -m venv venv

Activate the virtual environment (skip this step if you didn't create a virtual environment):

On Linux/macOS:

source venv/bin/activate

On Windows:

venv\Scripts\activate

Install project dependencies from requirements.txt:

pip install -r requirements.txt

Configuration

Create an .env file in the project root directory with the following environment variables:

Copy code
GOOGLE_CLIENT_ID="your-google-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-client-secret"
GOOGLE_REDIRECT_URI="http://localhost:5000/google/callback"

Replace the values with your Google OAuth2 credentials.

Usage

Run the Flask application:

flask --app src/app run --debug

Access the application in your web browser at http://localhost:5000.

License

This project is licensed under the MIT License

flask-google-auth's People

Contributors

iabhinavr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.