django - python social auth duplicate entry -


I am using Python-social-auth with the demo. I want to be authorized through Facebook, but first, I have already registered in an email (email, password) by default, which is to use Facebook. Can I add a Facebook account to the registered account? I tried to search but nothing

Check it, it should explain how to do it.

Associate user by email

Sometimes it is desirable that if the social accounts are connected automatically, then the email already matches a user account.

For example, with its Facebook account, it is logged out and Google attempts to use OAuth2 for the next time, it can be good (if both of the social sites The same email address is configured) then the user is in the initial account created by his Facebook backend. P>

This scenario is possible by enabling the Associate_by_mail pipeline function, such as:

  SOCIAL_AUTH_PIPELINE = ('social_core.pipeline.social_auth.social_details',' social_core.pipeline.social_auth.social_uid ',' Social_core.pipeline.social_auth.auth_allowed ',' social_core.pipeline.social_auth.social_user ',' social_core.pipeline.user.get_username ',' social_core.epipline.Social_Auth. Associate_by_mail ', # & lt; - - This is a 'social_core.pipeline.user.create_user', 'social_core.pipeline.social_auth.associate_user', 'enable social_core.pipeline.social_auth.load_extra_data', 'social_core.pipeline.user.user_details',)  

This feature is disabled by default Because it is not 100% safe to automate this process with all Bakands. Not all providers will validate your email account and other users can take advantage of it.

For example, register your site with user e-mail foo@bar.com. Then a malicious user registers in another provider who does not validate their email with the same account. In the end this user will retire and sign on your site (which supports the provider), because the email is the same, the malicious user will take control of the user account.

Edit: Fixed link and docs details copied in this reply.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -