Implementation of AspNetCore.Identity for LiteDB database engine.
LiteDB.Identity will allow quickly creates users login, registration, roles, claims and tokens functionalities for web application.
Please install latest version of LiteDB.Identity using NuGet:
Install-Package LiteDB.Identity
Next, in your Startup.cs file add reference to namespace:
using LiteDB.Identity.Extensions;
Add default LiteDb.Identity implementation in ConfigureServices method:
public void ConfigureServices(IServiceCollection services)
{
string connectionString = Configuration.GetConnectionString("IdentityLiteDB");
services.AddLiteDBIdentity(connectionString).AddDefaultTokenProviders().AddDefaultUI();
services.AddControllersWithViews();
services.AddRazorPages();
}
NOTE : appsettings.json should contains connection string to your LiteDB file. For more implementation details please refer to sample project.
Following interfaces has been implemented on :
- UserStore :
public class UserStore<TUser, TRole, TUserRole, TUserClaim, TUserLogin, TUserToken> :
IUserLoginStore<TUser>,
IUserStore<TUser>,
IUserRoleStore<TUser>,
IUserClaimStore<TUser>,
IUserPasswordStore<TUser>,
IUserSecurityStampStore<TUser>,
IUserEmailStore<TUser>,
IUserLockoutStore<TUser>,
IUserPhoneNumberStore<TUser>,
IQueryableUserStore<TUser>,
IUserTwoFactorStore<TUser>,
IUserAuthenticationTokenStore<TUser>,
IUserAuthenticatorKeyStore<TUser>,
IUserTwoFactorRecoveryCodeStore<TUser>
- RoleStore :
public class RoleStore<TRole, TRoleClaim> : IQueryableRoleStore<TRole>,
IRoleStore<TRole>,
IRoleClaimStore<TRole>
- Great for small and medium size AspNetCore Websites,
- Quick implementation of Authentication and Authorization mechanism for WebAPIs.
- LiteDB - https://www.litedb.org/
- LiteDB Github - https://github.com/mbdavid/LiteDB
- AspNetCore Identity - Introduction
- AspNetCore Github - https://github.com/dotnet/aspnetcore/tree/master/src/Identity
in progress …