How to add ASP.NET MVC5 authentication to an existing database

I am learning MVC5 authentication and reading materials at www.asp.net. Here I have a few questions.

  • If I want to use identity authentication, is there any reason not to use the MVC pattern? Or is there a reason to use an empty template? The MVC pattern also provides downloads.

  • I have created a database, I want to have the first database development. If I use the MVC pattern, the credential database will be created in the project folder. How can I combine two databases, or should I just use two databases?

If my question is stupid, just ignore me or let me tell you what to read first. I know that the people in the community are good, but critical. Thanks you

+30
asp.net-mvc-5 asp.net-identity
Sep 03 '14 at 18:35
source share
1 answer

1) If I want to use identity authentication, is there any reason not to use the MVC pattern? Or is there a reason to use an empty template? The MVC pattern also provides downloads.

Identity authentication, the MVC pattern, and bootstrap are not actually related.

If you are creating a new MVC 5 application, an AccountController is created for you. You can use this AccountController as a starting point.

If you want, you can remove the AccountController and create it yourself, but this is a lot of work.

2) I have created a database, I want to have the first database development. If I use the MVC pattern, the credential database will be created in the project folder. How can I combine two databases, or should I just use two databases?

You do not need two databases . You can place identity tables and your user tables in one database.

Start with Identity - create a database and the necessary tables. You can then add custom tables to this Identity database.

Or

If you already have a database with a connection string, you can change the Identity connection name in the following place. Identity will create its tables inside an existing database.

enter image description here

+37
03 Sep '14 at 19:07
source share



All Articles