A template for Google-authenticated flask applications.
A very simple template for use as a starting-point for Google-Authenticated (via OAuth 2) web applications.
The application relies upon Google's OAuth service for login.
First, download and install Docker Desktop.
Second, in the folder of your choosing, execute gh repo clone guyewhite/g-based.
- Go to https://console.developers.google.com/
- Create a new project (or pick an existing one)
- Under "APIs & Services → Credentials" click "Create Credentials → OAuth client ID"
- Note: If you have never before set up API services prior, you may be required to provide app information. In such a case, ensure you select as the audience "External" such that users can log into your app.
- Application type = "Web application"
- Add "Authorized redirect URIs", e.g.
- Copy the Client ID and Client Secret
- Create a
.envfile in the root directory that includes this content. TheFLASK_SECRET_KEYshould be a secure, lengthy, random string.
GOOGLE_CLIENT_ID: your‑google‑client‑id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET: your‑google‑client‑secret
FLASK_SECRET_KEY: some‑random‑string
Please note that your CLI may be set to hide files with a . (dot) at the front of the filename.
Once the above steps have been completed, you can execute the following command:
docker compose up --build
Then, with your web browser, browse to http://localhost:8080. If an error occurs, best to ensure that you have completed the setup steps above.
