I am using DRF as rest framework and want to use the social login for user signup and login. For now, I am using angular to signup with Google which is successful and got following response:
"id":"105372307735.........",
"name":"XYZ",
"email":"[email protected]",
"photoUrl":"https://lh4.googleusercontent.com/-C..............",
"authToken":"ya29.Glx2.....................",
"provider":"GOOGLE"
How could I use same response to register user and login in django rest framework?
Thanks
I know it's too late but this might help someone who is struggling with social logins hence posting it here. use this module django-rest-framework-social-oauth2, follow the instructions that are there on their official Github, they have examples for Facebook and Google.
Also, add these pipelines to your settings
This will allow users to authenticate themselves with multiple social logins for a single user account.
Run
and
if you've followed the instructions properly from their official GitHub, then you should be able to visit localhost:8000/auth/convert-token from where you can convert your tokens to your app tokens and use it to authenticate users.