abp vnext修改密码策略

打开Starup文件,在Configure添加或删除密码策略

public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            StaticHttpContextExtensions.AddHttpContextAccessor(services);

            services.AddApplication<PublicHealthHttpApiHostModule>();
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            //修改密码策略,增大或降低密码复杂度
            app.ApplicationServices.GetService<ISettingDefinitionManager>().Get(IdentitySettingNames.Password.RequireDigit).DefaultValue = false.ToString();//数字
            app.ApplicationServices.GetService<ISettingDefinitionManager>().Get(IdentitySettingNames.Password.RequireLowercase).DefaultValue = false.ToString();//小写
            //app.ApplicationServices.GetService().Get(IdentitySettingNames.Password.RequireUppercase).DefaultValue = false.ToString();//大写
            app.ApplicationServices.GetService<ISettingDefinitionManager>().Get(IdentitySettingNames.Password.RequireNonAlphanumeric).DefaultValue = false.ToString();//非数字符号
            app.ApplicationServices.GetService<ISettingDefinitionManager>().Get(IdentitySettingNames.Password.RequiredLength).DefaultValue = 6.ToString();//长度
             
            app.UseStaticHttpContext();
            app.InitializeApplication();
        }
    }

你可能感兴趣的:(abp,vnext密码策略)