Flask App with Google Login
A very good guide from Real Python.
Real Python's Create a Flask Application With Google Login by Alexander VanTol
The only change I made to test it locally was removing pyOpenSSL
. So, for testing I ran it on http://127.0.0.1:5000
. That's what I set in Google Cloud Console.
Also, for testing locally / development purposes only, set the environment variable OAUTHLIB_INSECURE_TRANSPORT=1
so oauthlib can run in non-HTTPS connection.
Source: ZeroTwo's answer on Stack Overflow.
I found that setting up SSL for localhost is a lot more complicated. It's easier to set SSL of an online website.