Add Identity to ASP.NET Core

We have factored out the code needed to implement Microsoft ASP.NET Core Identity security to Web APIs and applications (Blazor, Razor, MVC etc). This code implements a custom UserStore and custom RoleStore to manage access to a customised Identity data store (on SQL Server). Details of this customisation are here.

builder.Services.AddIdentity<UserCredential, AssignedUserRole>(
    options =>
    {
        options.Password.RequireLowercase = true;
        options.Password.RequireUppercase = true;
        options.Password.RequireDigit = true;
        options.Password.RequireNonAlphanumeric = true;
        options.Password.RequiredLength = 8;
    })
    .AddDefaultTokenProviders();

The classes UserCredential and AssignedUserRole are part of the Identity object model.

Posted in Knowledge Base and tagged , , , .

One Comment

  1. Pingback: Add JWT Security to Web API - Visual Software Construction Ltd

Leave a Reply

Your email address will not be published. Required fields are marked *