Simple Python Flask app that performs Google OAuth 2.0 authentication and displays the raw token response (access token, refresh token, etc.).
pip install -r requirements.txtpython app.pyThen open http://localhost:8080 — it redirects to Google's consent screen. After granting access, the callback page displays the full token JSON from Google.
All credentials are stored in .env (not committed to git):
GOOGLE_CLIENT_ID— OAuth client IDGOOGLE_CLIENT_SECRET— OAuth client secretGOOGLE_SCOPE— Comma-separated scopesGOOGLE_ACCESS_TYPE— Set toofflineto receive a refresh token
- Redirect URI:
http://localhost:8080/callback(must be registered in Google Cloud Console) prompt=consentis set to force the consent screen so Google always returns a refresh token- The callback page renders the full JSON response from Google's token endpoint