[Django]-Django website as a backend with Google+ Login

4👍

This post helped me a lot to set up a similar structure: http://blog.wizer.fr/2013/11/angularjs-facebook-with-a-django-rest-api. You will have to change angularjs with android but requests are exactly the same and it works. Basically, the steps the post explains are:

  • Obtain Google+ credentials with the client. You end with an access token.
  • Send this access token to your backend. With python-social-auth, request the data for that user, if it doest not exist, create a new user with the data. It also creates an access token (using drf token authentication).
  • Send back this token to the user. Now, the user can do requests to your api using this token. Another step could be added in case you want this tokens to expire.

Hope it helps.

👤argaen

1👍

Here is an answer that could help you.

As it is mentioned in the answer, you can either do the login using the main application or login to google and then send the credentials as you want.

To handle the communication with your site i recommend using a REST api. There are several alternatives, with django-REST-framework and tastypie leading the charts. I know django-REST-framework includes an oauth and oauth2 implementation, have not worked with tastypie

Leave a comment