My question is almost the same as this one
only difference is that users has an option to register (provides his username and password).Users should only have one account registered, if the user has the same email I merged those accounts. and my application has another method for logging in which is via Facebook.
What I basically do is
- When The User visits the for site for the first time, he or she then gets created a User Account where the it only has Username ,password and mail address after that third-party identity record is created and then paired with the local account.however the Users table will have an empty Username and password, but the email will be filled with the users email that we have retrieved from the third party service provider
And the Second Scenario
- Users attempts Register to the site. check if email exist if the email exist but it is registered using a third party account, Use the user populated form and insert it to the user account paired with the third party account, in short if the users email exist in the database I will just merged the locally created account and the third party account.
Now my question is my approach secure and credible? if not what is the best way to merge accounts and at the same time if the user registers with the same email(the one from the third party account) and he has a third party account, those account would be merge?