/flask-google

Flask app with Google authentication

Primary LanguagePython

Flask App with Google Authentication

This is an example flask application that demonstrates implementing Google authentication using google_auth_oauthlib.

This app doesn't do much on it's own, but it can be a useful resource to learn how Google authentication works.

Usage

In order to run the application, you'll first need to generate a client_secret.json file from the Google Cloud Console. Place this file alongside files from this repository and then run:

python3 install -r requirements.txt
OAUTHLIB_INSECURE_TRANSPORT=1 python3 -m flask --app=main.py run --port=80

If this command completes successfully, you should have a web application running at http://localhost that allows logging in via Google.

Creating Secrets

In order to generate client_secret.json, you should:

  1. Login to Google Cloud Console
  2. Create a new project
  3. Create new OAuth Client ID in the Credentials area
  4. Download client_secret.json