Thanks to @lagess's answer: http://q.cnblogs.com/q/68698/
Method One:
1. Install Identity with NuGet.
2. Add a link string:
<add name="defaultconnection" connectionstring="Data source=.\ Sqlexpress;initial CATALOG=SJK; User id=**;p assword=********; "providername="System.Data.SqlClient "/>
Note: name= "defaultconnection" do not change, otherwise the identity will be error.
Connection string details can be seen: http://msdn.microsoft.com/zh-cn/library/ms254494 (v=vs.110). aspx. There is also a description of the string encryption.
3, add a large pile and the identity of the east, interested can Google a bit.
Method Two:
This is my recommendation, because I am a rookie, take the easy way
1, vs generates a MVC5 project. The project name is the same as your original project, otherwise it will be said during debugging: <%@ application codebehind= "Global.asax.cs" inherits= " Ninthpatternmember.mvcapplication "language=" C #%> is wrong.
2. Running the project will automatically generate an identity-related table in your database.
3, delete its content, scripts folder.
4. Test your project folder into the corresponding folder in MVC5.
OK, you can enjoy the new features brought by identity.
Using the ASPNET Identity 2.0 combat in an existing project