Integrating Google authentication into the Django server
Objective: In order to facilitate the login process in our android app, we decided to include an option to login using Google, to do so we need to change the way our server works
Allauth package
Firstly we need to consider a new package for Django, the allauth since it enables our service to interact with the APIs of several social apps, the desired one is google.
Two databases
Although we desire to include the Google authentication we do not want to stop using the normal authentication method, the one already built, as such we need to consider two separate databases, our existing DB and a new one to store the mappings of google tokens to users in our service, in order to maintain a single codebase we need to tell Django to consider both DBs and to allow a single codebase
After that is completed, once we migrate the changes we can see that our application is considering a new user DB in social accounts
We can now add a new social application since we only enabled the provider for Google when selecting the application we are only presented with Google
We now need a client key, to do that we need to use the google developers to generate our application secret keys
Integrating Google authentication into the Django server
Objective: In order to facilitate the login process in our android app, we decided to include an option to login using Google, to do so we need to change the way our server works
Allauth package
Firstly we need to consider a new package for Django, the allauth since it enables our service to interact with the APIs of several social apps, the desired one is google.
Two databases
Although we desire to include the Google authentication we do not want to stop using the normal authentication method, the one already built, as such we need to consider two separate databases, our existing DB and a new one to store the mappings of google tokens to users in our service, in order to maintain a single codebase we need to tell Django to consider both DBs and to allow a single codebase
After that is completed, once we migrate the changes we can see that our application is considering a new user DB in social accounts We can now add a new social application since we only enabled the provider for Google when selecting the application we are only presented with Google
We now need a client key, to do that we need to use the google developers to generate our application secret keys