Skip to content

jpresley/CustomIdentityManagement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Setup

  1. Copy the UsersAdmin and RolesAdmin folder to the Views folder

  2. Copy the IdentityManagement folder to the root of the web project

  3. Find and replace all instances of CustomIdentityManagement with the name of your web project

  4. Open the IdentityInitializer.cs file and update the default admin email and password at the top of the class

  5. Add the following to the ConfigureAuth(IAppBuilder app) method of the App_Start/Startup.Auth.cs file below the other app settings.

    app.CreatePerOwinContext<ApplicationRoleManager>(ApplicationRoleManager.Create);

Initialization

  1. Ensure that the DefaultConnection in the web.config file is pointing to the desired database
  2. Run the app and call the InitIdentity controller (domain.com/InitIdentity).

Usage

  1. To manage users call the UsersAdmin index view (domain.com/UsersAdmin)
  2. 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>
}

About

Custom user, role and initialization for ASP.NET Identity

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages