1

I want to get the detail of all the users those who have login through google oauth and want to print all the details for my project.

I am just getting the detail of the current user who have login using the google login.

Kartik
  • 83
  • 9

1 Answers1

4

To list all the users signed in using google

from social_django.models import UserSocialAuth
# select_related for performance.
google_logins = UserSocialAuth.objects.select_related("user").filter(provider="google-oauth2")
for google_login in google_logins:
    print(google_login.user.pk, google_login.user.email)
Hari
  • 1,545
  • 1
  • 22
  • 45