Using Google for authentication
Just like we did for Facebook, we can integrate our application to enable login using Google.
Getting ready
Start by building over the last recipe. It is easy to implement Google authentication by simply leaving out the Facebook-specific elements as it is.
Now, create a new project from the Google developer console (https://console.developers.google.com). In the APIs and Services section, click on Credentials. Then, create a new client ID for the web application; this ID will provide the credentials needed for OAuth 2 to work. You will also need to configure the OAuth consent screen before a client ID can be created, as shown in the following screenshot:
Figure 6.9 – Google app configuration
How to do it…
To enable Google authentication in your application, follow these steps:
- As always, start with the configuration part in
my_app/__init__.py
, as follows:app.config["GOOGLE_OAUTH_CLIENT_ID...