0

By overriding the SocialAccountManager

def save_user(self, request, sociallogin, form=None):
    """
    Saves a newly signed up social login. In case of auto-signup,
    the signup form is not available.
    """
    u = sociallogin.user
    u.set_unusable_password()
    if form:
        get_account_adapter().save_user(request, u, form)
    else:
        get_account_adapter().populate_username(request, u)
    sociallogin.save(request)
    return u

how to get the password from social account signup

Edwin Babu
  • 709
  • 8
  • 15

2 Answers2

0

Actually, you can't.

Django Allauth does not hash or store passwords for social login users. It does not handle the authentication on its end.

Suppose a user try to do a google login at your website, the authentication happens on google servers not on your end. If the user's password is correct then LOGIN_REDIRECT_URL = "url-name/" defined in your django project redirects that user to the url.

0

You can't get the password. If you can, or those social apps share the password of their users, then both you and that social apps have violate the user privacy rules. In my opinion it's a crime.

The only way you could do is ask your user to set a new password for your site. Send them an email to confirm the change. But that means you have to make an additional route for your app, which has no point.

tangorboyz
  • 39
  • 8