How to implement an ASP.NET identifier for an empty MVC project

I am creating a new empty MVC project and I want to add an identifier to it. Now I do not know how to do this and how to create databases, tables and classes. I searched, but I did not find a useful solution for my question, I found an article for adding ASP.NET Identity to an existing empty ASP.NET web page, but I did not find a project for ASP.Net MVC .
to login to the registration form
to add a user to a role
to delete a user
how to create tables in my own database
how to manage users

+45
asp.net-mvc asp.net-identity
Mar 08 '14 at 18:31
source share
4 answers
+63
Jul 05 '14 at 9:09
source share

Open the nuget package manager by going to:

 Tools > Nuget Package Manager > Package Manager Console 

in the new project [1] . From there you can enter next to PM>

 Install-Package Microsoft.AspNet.Identity.Samples -Pre 

which will set up an Identity sample for you. He will ask you if you allow to change your webconfig by pressing "A", you accept all the changes.

From this moment, a sample identification project will be installed!

Note. It will change the default namespace, therefore, by going to β€œfind and replace”, you can quickly change the appearance to your project name (note that you may need to go to the global.aspx page in the folder of my documents - open it in notepad and change the namespace there!)




[1] : If you do not do this at the beginning of your development, you will find that the following files will be overwritten (so make sure you have a way to combine the originals with the new one):

 Overwrite existing file 'Views\Web.config'. Overwrite existing file 'Views\Shared\Error.cshtml'. Overwrite existing file 'Views\Shared\_Layout.cshtml'. Overwrite existing file 'Views\Home\Index.cshtml'. Overwrite existing file 'Views\_ViewStart.cshtml'. Overwrite existing file 'Global.asax.cs'. Overwrite existing file 'Global.asax'. Overwrite existing file 'Controllers\HomeController.cs'. Overwrite existing file 'Content\Site.css'. Overwrite existing file 'App_Start\RouteConfig.cs'. Overwrite existing file 'App_Start\FilterConfig.cs'. Overwrite existing file 'App_Start\BundleConfig.cs'. 
+7
Mar 23 '15 at 14:07
source share

The following article describes the basics of adding ASP.NET Identity to your application. http://www.asp.net/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project

0
Mar 10 '14 at 16:41
source share

You can integrate the ASP.NET ID from the NuGet gallery. These packages can be installed using the NuGet Package Manager console, for example:

Install-Package Microsoft.AspNet.Identity.EntityFramework -Version 2.2.1

Microsoft.AspNet.Identity.Core -Version 2.2.1 Installation Package

Microsoft.AspNet.Identity.OWIN Installation Package -Version 2.2.1

In addition, you simply create a separate MVC project with a default template and where you have classes and methods for implementing the ASP.NET identifier as a reference, so just use these classes in your new project.

If you are using an existing database with an Entity Framework with a basic database base, then create a separate connection string and data context for ASP.NET authentication. Because Entity Framework with Edmx uses the System.Data.EntityClient provider, while ASP.NET Identity uses the System.Data.SqlClient provider.

0
Aug 26 '16 at 5:43
source share



All Articles