I want to use python-social-auth for my webservice but I'm not 100% sure how it works:
When I sign up with my github account (let's say my github account is called joe) then python-social-auth creates a new user named joe and user.username
also joe.
But what happens if another user wants to sign up, i.e. using a google account, but this user has the google username joe.
What happens on my webservice then? will python-social-auth complain and say that there is already a user named joe, or will it be able to distinguish the github user and the google user?
and will the user.username
be joe for both?!
python-social-auth
will create a unique username for each user in case of a collision, the default resolving method is to append a hash to the end of the username, so it will became joed41d8cd98f00...
, the method that takes care of that is here https://github.com/omab/python-social-auth/blob/master/social/pipeline/user.py#L9-L53.
You can override the default behavior by replacing that method in the pipeline (or adding another after that one which applies some transformation to the generated username).