1

I am using MVC 4 and SQL Server with my application database. I want to add user authentication where the user will have extra fields when registering (e.g. address, telephone, etc...). What is the correct way to accomplish this?

I have considered the following options:

  1. Generate a separate aspnetdb db and authenticate against it, alter the user columns in it and use the main application db after authentication, presumably using sessions to store user info.

  2. Don't create a aspnetdb, but add the aspnetdb tables to the application db and add additional fields to the relevant generated table.

  3. As #2 above, but create a separate user table in the application db and join the relevant aspnetdb on an existing table.

Alexander
  • 2,320
  • 2
  • 25
  • 33
John Fleming
  • 267
  • 1
  • 3
  • 12

1 Answers1

3

ASP.NET MVC 4 uses the SimpleMemebrship provider out of the box. You could add custom fields to the UserProfile table. Here's a step-by-step article explaining how you could achieve that.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928