Currently I have a registration with Django Rest Auth where I implement a login with Google under an extended user model with AbstractUser, the problem is that when authenticating with Google, when the user registers it does not store the username and email of the email I entered With google. Any ideas?
This is the AbstractUser model:
class User(AbstractUser):
full_name = CharField(_("Full Name"), max_length=255, null=True, blank=True)
device_token = models.CharField(_("Device Token"), max_length=200, null=True, blank=True)
cellphone = CharField(_("CellPhone"), max_length=15, null=True, blank=True)
class Meta:
verbose_name = "User"
verbose_name_plural = "Users"
def get_absolute_url(self):
return reverse("users:detail", kwargs={"username": self.username})
This is the example of a user who has logged in with Google, this is how the model looks in the database: Model User with Google Request with token user
Whats is the problem?
I hope that google stores the email and user at the time of registering in the Django database.
I managed to solve the problem. This is because the verification of the Google Cloud OAuth App was not completed https://support.google.com/cloud/answer/10311615?authuser=2&hl=es-419#verification-status. Until it is completely verified, it will not be possible to extract from Google the username and email of the person who is trying to log into the system. Always check that your Google application has been verified so that you can extract the data you need.