eamorgado / FoodieShoot

A computer vision app that uses Tensorlfow to detect food on the plate and analyse its contents. The app is supported by a django server.
https://foodieshoot.en.aptoide.com/app?store_name=ciber-foodieshoot
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Add google authentication in application/site #21

Closed eamorgado closed 4 years ago

eamorgado commented 4 years ago

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 image 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 image

eamorgado commented 4 years ago

Update - Close

Issue closed, enabling Oauth from google will not yet be implemented