0
votes

currently I need to provide web site logging for different social accounts (facebook, google, twitter and so on).

I know that stackoverflow has same system and I wonder if there is stackoverflow database model in public access. So I can find right way to store user data in my db.

Currently I have next problems.

So, I have my table for users:

  • UserID
  • UserName
  • RegistrationDate
  • Email
  • Rating

For users who create account with web site form I use next additional info:

  • Password
  • FirstName
  • LastName
  • Avatar

I stock in question how to store data for users who login with social networks and what should I store. It seems that I dont need to store facebook name, surname and so on. I thought about getting it with js on pages where I need it.

Also I am thinking how to provide user with adding facebook, twitter references and so on for his profile.

P.S. I am using DotNetOpenAuth for user authentication via social networks. Working with asp.net MVC 3. About functionality on my web site: just adding articles and rating for user. For comments I use https://disqus.com/.

1

1 Answers

0
votes

Ideally, you should have two tables. One for Users and one for Identities. In the Users table, you store things like your application user id, name, emails, etc. In the Identities table, you link back to the person in the User's table, but have a 'network' field that says which network the Identities row is for (e.g. Facebook, Google, Twitter, etc).

The Identities table can store the User ID and details specific to that platform, e.g. User_ID for Facebook, Twitter username, etc. The user will have one entry in the Users table, but can have many entries in the Identities table, depending on how many networks the user has connected with.