public MfaFido2SignInFidoController( Fido2Storage fido2Storage, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IOptions <Fido2Configuration> optionsFido2Configuration, IStringLocalizerFactory factory) { _userManager = userManager; _optionsFido2Configuration = optionsFido2Configuration; _signInManager = signInManager; _userManager = userManager; _fido2Storage = fido2Storage; var type = typeof(SharedResource); var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName); _sharedLocalizer = factory.Create("SharedResource", assemblyName.Name); _lib = new Fido2(new Fido2Configuration() { ServerDomain = _optionsFido2Configuration.Value.ServerDomain, ServerName = _optionsFido2Configuration.Value.ServerName, Origin = _optionsFido2Configuration.Value.Origin, TimestampDriftTolerance = _optionsFido2Configuration.Value.TimestampDriftTolerance }); }
public MfaFido2SignInFidoController( Fido2Storage fido2Storage, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IOptions <Fido2Configuration> optionsFido2Configuration, IOptions <Fido2MdsConfiguration> optionsFido2MdsConfiguration, IStringLocalizerFactory factory) { _userManager = userManager; _optionsFido2Configuration = optionsFido2Configuration; _optionsFido2MdsConfiguration = optionsFido2MdsConfiguration; _signInManager = signInManager; _userManager = userManager; _fido2Storage = fido2Storage; var type = typeof(SharedResource); var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName); _sharedLocalizer = factory.Create("SharedResource", assemblyName.Name); var MDSCacheDirPath = _optionsFido2MdsConfiguration.Value.MDSCacheDirPath ?? Path.Combine(Path.GetTempPath(), "fido2mdscache"); _mds = string.IsNullOrEmpty(_optionsFido2MdsConfiguration.Value.MDSAccessKey) ? null : MDSMetadata.Instance( _optionsFido2MdsConfiguration.Value.MDSAccessKey, MDSCacheDirPath); if (null != _mds) { if (false == _mds.IsInitialized()) { _mds.Initialize().Wait(); } } _lib = new Fido2(new Fido2Configuration() { ServerDomain = _optionsFido2Configuration.Value.ServerDomain, ServerName = _optionsFido2Configuration.Value.ServerName, Origin = _optionsFido2Configuration.Value.Origin, // Only create and use Metadataservice if we have an acesskey MetadataService = _mds, TimestampDriftTolerance = _optionsFido2Configuration.Value.TimestampDriftTolerance }); }