Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.12 KB

README.md

File metadata and controls

36 lines (29 loc) · 1.12 KB

AspNetCore.Identity.LiteDB

A LiteDB provider for ASP.NET Core Identity framework.

Nuget Package

https://www.nuget.org/packages/AspNetCore.Identity.LiteDB

How to use

You have to add the following lines to your Startup.cs in the ASP.NET Core Project.

public void ConfigureServices(IServiceCollection services)
{

// Add LiteDB Dependency
services.AddSingleton<LiteDbContext>();

services.AddIdentity<ApplicationUser, IdentityRole>(options =>
                {
                    options.Password.RequireDigit = false;
                    options.Password.RequireUppercase = false;
                    options.Password.RequireLowercase = false;
                    options.Password.RequireNonAlphanumeric = false;
                    options.Password.RequiredLength = 6;
                })
.AddUserStore<LiteDbUserStore<ApplicationUser>>()
.AddRoleStore<LiteDbRoleStore<IdentityRole>>()
.AddDefaultTokenProviders();

}

Also make sure you use the right using Statements in Startup.cs, AccountController, ManageController and Values Controller.

using AspNetCore.Identity.LiteDB;
using AspNetCore.Identity.LiteDB.Models;