public void ShouldPasswordStrenghtSameOfConfiguration(PasswordHasherStrenght strenght) { var services = new ServiceCollection(); services.UpgradePasswordSecurity().WithStrenghten(strenght).UseScrypt<GenericUser>(); var provider = services.BuildServiceProvider(); var passwordHasherOptions = (IOptions<ImprovedPasswordHasherOptions>)provider.GetService(typeof(IOptions<ImprovedPasswordHasherOptions>)); passwordHasherOptions.Value.Strenght.Should().Be(strenght); }
/// <summary> /// Password Strengten. If set will change values from OpsLimit and MemLimit /// </summary> public IPasswordHashBuilder WithStrenghten(PasswordHasherStrenght strenght) { Options.Strenght = strenght; return(this); }