首页 > 解决方案 > ASP.NET Core Identity 的密码策略在哪里?

问题描述

Individual User Accounts我创建了带有身份验证选项的 ASP.NET Core Web 应用程序(目标 .NET Core 3.1)MVC 。

在此处输入图像描述

当我运行程序时,我注意到帐户Register功能启用了密码策略。我的问题是密码策略代码在哪里?

在此处输入图像描述

我没有注意到任何密码策略配置Startup.cs

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddDbContext<ApplicationDbContext>(options =>
            options.UseSqlServer(
                Configuration.GetConnectionString("DefaultConnection")));
        services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
            .AddEntityFrameworkStores<ApplicationDbContext>();
        services.AddControllersWithViews();
        services.AddRazorPages();
    }

标签: c#asp.net-identity

解决方案


推荐阅读