Custom Identity Management
Custom user, role and initialization for ASP.NET MVC Identity
Custom Identity Management is an alternative to (but largely derived from) the Identity Sample NuGet package
Copy the UsersAdmin and RolesAdmin folder to the Views folder
Copy the IdentityManagement folder to the root of the web project
Find and replace all instances of CustomIdentityManagement with the name of your web project
Open the IdentityInitializer.cs file and update the default admin email and password at the top of the class
Add the following to the ConfigureAuth(IAppBuilder app) method of the App_Start/Startup.Auth.cs file below the other app settings.
- Ensure that the DefaultConnection in the web.config file is pointing to the desired database
- Run the app and call the InitIdentity controller (domain.com/InitIdentity).
- To manage users call the UsersAdmin index view (domain.com/UsersAdmin)
- To manage roles call the RolesAdmin index view (domain.com/RolesAdmin)
@if (Request.IsAuthenticated && User.IsInRole("Admin"))
<a href="@Url.Action("Index","UsersAdmin")">Users Admin</a>
<a href="@Url.Action("Index","RolesAdmin")">Rules Admin</a>