BetterRedisIdentity 1.0.0.34
dotnet add package BetterRedisIdentity --version 1.0.0.34
NuGet\Install-Package BetterRedisIdentity -Version 1.0.0.34
<PackageReference Include="BetterRedisIdentity" Version="1.0.0.34" />
<PackageVersion Include="BetterRedisIdentity" Version="1.0.0.34" />
<PackageReference Include="BetterRedisIdentity" />
paket add BetterRedisIdentity --version 1.0.0.34
#r "nuget: BetterRedisIdentity, 1.0.0.34"
#:package BetterRedisIdentity@1.0.0.34
#addin nuget:?package=BetterRedisIdentity&version=1.0.0.34
#tool nuget:?package=BetterRedisIdentity&version=1.0.0.34
Better Redis Identity
While there are currently several projects available to connect and interface with Redis, I have found that they are not fully implemented/lack support or have critical bugs that make them unreliable.
🧐 Features
- All user and role stores are implemented.
- Built upon AsyncRedisDocuments (https://github.com/BrylyMaeder/AsyncRedisModels)
- Works out of the box
🛠️ Install Dependencies
nuget install BetterRedisIdentity
This will only work for a Redis Database that has Redis Search activated.
Important Information
Please review AsyncRedisModels to ensure you're familiar with how the ApplicationUser and ApplicationRole is expected to work. They are both IAsyncDocuments.
🧑🏻💻 Setup and Installation
First and and most importantly; initialize your redis singleton.
RedisSingleton.Initialize("host", port, "password");
Make sure your ApplicationUser
enherits from RedisIdentityUser
and your ApplicationRole inherits from RedisIdentityRole
public class ApplicationUser : RedisIdentityUser
public class ApplicationRole : RedisIdentityRole
Next up, add your stores.
builder.Services.AddRedisIdentityStores<ApplicationUser, ApplicationRole>();
If you need to use a custom user manager for your project, please ensure that you enherit from
RedisUserManager<TUser>
Our manager is necessary and is automatically included with AddRedisIdentityStores()
Setup your identity how you like.
builder.Services.AddIdentity<ApplicationUser, ApplicationRole>(options =>
{
options.SignIn.RequireConfirmedAccount = false;
options.User.RequireUniqueEmail = true;
}).AddDefaultTokenProviders()
.AddSignInManager();
Everything else forwards is pretty standard, include your authentication scheme and you should be all set.
builder.Services.AddAuthentication(options =>
{
options.DefaultScheme = IdentityConstants.BearerScheme;
options.DefaultSignInScheme = IdentityConstants.BearerScheme;
}).AddBearerToken();
Author
Bryly Maeder
- Github: https://github.com/BrylyMaeder
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- AsyncRedisModels (>= 1.0.0.26)
- Microsoft.AspNetCore.Components.Authorization (>= 9.0.3)
- Microsoft.AspNetCore.Identity (>= 2.3.1)
- Microsoft.Extensions.Identity.Core (>= 9.0.3)
- Microsoft.Extensions.Identity.Stores (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.