Authentication using Google

Google offers OAuth2 authentication. You can read about Google's OAuth2 implementation at https://developers.google.com/identity/protocols/OAuth2.

To implement authentication using Google, add the following line to the AUTHENTICATION_BACKENDS setting in the settings.py file of your project:

'social_core.backends.google.GoogleOAuth2',

First, you will need to create an API key in your Google Developer Console. Open https://console.developers.google.com/apis/credentials in your browser. Click on Select a project and create a new project, as follows:

After the project is created, under Credentials, click on Create credentials ...

Get Django 2 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.