Skip to content

devinSpitz/LiteDB.Identity.Async

Repository files navigation

CircleCI CodeFactor NuGet stable version Discord

LiteDB.Identity.Async

I only added the async wrapper and adapted everything to it.
Now you can simply use the async functions.
Nuget

Usage:

Add default LiteDb.Identity.Async implementation in ConfigureServices method:

        public void ConfigureServices(IServiceCollection services)
        {

            string connectionString = Configuration.GetConnectionString("IdentityLiteDB");
            services.AddLiteDbIdentityAsync(connectionString).AddDefaultTokenProviders().AddDefaultUI();

            services.AddControllersWithViews();
            services.AddRazorPages();
        }
Usage of Database:
     
     ILiteDbIdentityAsyncContext _liteDb;
      await _liteDb.LiteDatabaseAsync.GetCollection<Map>("Map")
                .FindOneAsync(x => x.Id == id);


Usage of Authorize


    [Authorize]
    [Authorize(Roles = "Admin")]

Following interfaces has been implemented on :

  • UserStore :
    public class UserStoreAsync<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 RoleStoreAsync<TRole, TRoleClaim> : IQueryableRoleStore<TRole>, 
                                                IRoleStore<TRole>, 
                                                IRoleClaimStore<TRole>

You will find more examples in the repo:

PavlovRconWebserver

ps. currently only on the TestBranch.

Donate:

Feel free to support my work by donating:

Donate with PayPal

Business:

For business inquiries please use:

devin@spitzen.solutions

References:

Where to use it ?

  • Great for small and medium size AspNetCore Websites,
  • Quick implementation of Authentication and Authorization mechanism for WebAPIs.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published