mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Refactor WebAuthn IoC container (#1302)
* Refactor WebAuthn IoC container * Move to AddDefaultServices
This commit is contained in:
@ -126,6 +126,9 @@ namespace Bit.Core.Utilities
|
||||
|
||||
public static void AddDefaultServices(this IServiceCollection services, GlobalSettings globalSettings)
|
||||
{
|
||||
// Required for UserService
|
||||
services.AddWebAuthn(globalSettings);
|
||||
|
||||
services.AddSingleton<IPaymentService, StripePaymentService>();
|
||||
services.AddSingleton<IMailService, HandlebarsMailService>();
|
||||
services.AddSingleton<ILicensingService, LicensingService>();
|
||||
@ -535,5 +538,16 @@ namespace Bit.Core.Utilities
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
public static void AddWebAuthn(this IServiceCollection services, GlobalSettings globalSettings)
|
||||
{
|
||||
services.AddFido2(options =>
|
||||
{
|
||||
options.ServerDomain = new Uri(globalSettings.BaseServiceUri.Vault).Host;
|
||||
options.ServerName = "Bitwarden";
|
||||
options.Origin = globalSettings.BaseServiceUri.Vault;
|
||||
options.TimestampDriftTolerance = 300000;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user