July 2019
Beginner to intermediate
302 pages
9h 38m
English
To enable Google authentication in your application, follow these steps:
app.config["GOOGLE_OAUTH_CLIENT_ID"] = "my google OAuth client ID"app.config["GOOGLE_OAUTH_CLIENT_SECRET"] = "my google OAuth client secret"app.config["OAUTHLIB_RELAX_TOKEN_SCOPE"] = Truefrom my_app.auth.views import google_blueprintapp.register_blueprint(google_blueprint)
In the preceding code snippet, we registered the Google blueprint provided by Flask-Dance with our application for authentication. This blueprint will be created in the views file, which we will take a look at next. Note the additional configuration option, OAUTHLIB_RELAX_TOKEN_SCOPE. This is suggested ...