Skip to content Skip to sidebar Skip to footer

Users Are Not Created After Login With Facebook (probably An Homonymy Case)

I am trying to learn how to integrate python social auth into a django project. It seems to work, because I can log into my test application, but it seams that the user is never st

Solution 1:

Quick answers to your questions:

  1. No
  2. Nothing is needed to accomplish that.

To me it looks like you were logged in with that admin user before clicking your Login with Facebook link. python-social-auth will take the current logged in user and associate the social account to it (if there's any user logged in), otherwise it will create a new account. But, if the social account was already used in your site, it will login the related user, or drop an exception indicating that the social account is already in use.

You can check the related user to a social account with this:

from social.apps.django_app.default.models import UserSocialAuth

for social in UserSocialAuth.objects.all():
  print social.provider, social.user.id, social.user.username

This is what I would do in your case:

  1. Trash the database, or delete the content in the table social_auth_usersocialauth
  2. Go to /admin and ensure that you are logged out
  3. Try to login with Facebook again

This time a new user account should be created.

Post a Comment for "Users Are Not Created After Login With Facebook (probably An Homonymy Case)"