1
0
mirror of https://github.com/bitwarden/server synced 2025-12-11 22:03:38 +00:00

[PM-19055] Add OTP Token Provider that is not dependent on the User entity (#6081)

* feat(pm-19055) : 
  - Add generic OTP generator. This OTP generator is not linked to .NET Identity giving us flexibility.
  - Update `OtpTokenProvider` to accept configuration object to keep interface clean.
  - Implement `OtpTokenProvider` in DI as open generic for flexibility.
* test: 100% test coverage for `OtpTokenProvider`
* doc: Added readme for `OtpTokenProvider`
This commit is contained in:
Ike
2025-07-17 17:44:20 -04:00
committed by GitHub
parent ec70a18bda
commit 828003f101
6 changed files with 807 additions and 0 deletions

View File

@@ -378,6 +378,8 @@ public static class ServiceCollectionExtensions
public static IdentityBuilder AddCustomIdentityServices(
this IServiceCollection services, GlobalSettings globalSettings)
{
services.TryAddTransient(typeof(IOtpTokenProvider<>), typeof(OtpTokenProvider<>));
services.AddScoped<IOrganizationDuoUniversalTokenProvider, OrganizationDuoUniversalTokenProvider>();
services.Configure<PasswordHasherOptions>(options => options.IterationCount = 100000);
services.Configure<TwoFactorRememberTokenProviderOptions>(options =>