title: Architecture for merging multiple user accounts together
body: <p>Okay, I got a website where you can register yourself and login. You can also login with your facebook, twitter or linkedin account.</p>
  
  <p>It is important that users only have one account registered. So somehow, I want to merge the accounts of users if they use different methods to login. What is the best solution to solve this?</p>
  
  <p>For instance, the user logs in with his Facebook account. I use the data to register an account for him automatically. Should I sent an e-mail with an username and password of our website? (If this is okay with the policy of Facebook). Should I give them a second screen where they can fill in an username and password? But that's not the idea behind logging in with your Facebook account. It should simplify your procedure to participate.</p>
  
  <p>It's also possible the user has registered himself on our website and the next time he logs in with his twitter account. How can I merge these 2 accounts as one? What's the best way?</p>
  
  <p>So basically my question is: I got 4 different ways a user becomes a member of our website. How can I make sure all these 4 ways only create one account if a user decides to use multiple ways? What's the best flow to make sure that it doesn't become a hassle for the user himself?</p>
  
  <hr>
  
  <p>Edit: </p>
  
  <p>3 years after I asked this question, I am giving the answer myself in a series of articles: 
  <a href="https://www.peternijssen.nl/social-network-authentication-setup/" rel="noreferrer">https://www.peternijssen.nl/social-network-authentication-setup/</a><br>
  <a href="https://www.peternijssen.nl/social-network-authentication-google/" rel="noreferrer">https://www.peternijssen.nl/social-network-authentication-google/</a><br>
  <a href="https://www.peternijssen.nl/social-network-authentication-merging-accounts/" rel="noreferrer">https://www.peternijssen.nl/social-network-authentication-merging-accounts/</a><br>
  <a href="https://www.peternijssen.nl/social-network-authentication-twitter-facebook/" rel="noreferrer">https://www.peternijssen.nl/social-network-authentication-twitter-facebook/</a>   </p>