提供的密码无效。密码必须符合为默认提供程序配置的密码强度要求

时间:2021-05-05 05:00:41

How to prevent that error?

如何防止这种错误?

The password supplied is invalid. Passwords must conform to the password strength requirements configured for the default provider.

提供的密码无效。密码必须符合为默认提供程序配置的密码强度要求。

I do migration users from the old ASP website to a new ASP .NET MVC 4 Website.

我将迁移用户从旧的ASP网站迁移到新的ASP .NET MVC 4网站。

var newUser = System.Web.Security.Membership.CreateUser(oldUser.Login, oldUser.Password, userEMail);

web.config

web.config中

 <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add connectionStringName="MembershipConnection" enablePasswordRetrieval="false"
             enablePasswordReset="true" 
             requiresQuestionAndAnswer="false" 
             requiresUniqueEmail="false" 
             maxInvalidPasswordAttempts="5" 
             minRequiredPasswordLength="3" 
             passwordStrengthRegularExpression=""
             minRequiredNonalphanumericCharacters="0" 
             passwordAttemptWindow="10" 
             applicationName="MyCoolApplication" 
             name="DefaultMembershipProvider" 
             type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </providers>
    </membership>

And it seems I need correct solution for some users who have incorrect password.

对于密码错误的用户来说,我似乎需要正确的解决方案。

How I can manage it in a proper way?

我如何以适当的方式管理它?

Thanks!

谢谢!

1 个解决方案

#1


1  

Based on the assumption that you are using the same .NET MVC version. Why not skip C#, use the SQL knowledge we got from school?

基于您使用相同.NET MVC版本的假设。为什么不跳过C#,使用我们从学校获得的SQL知识?

Insert into [newDB].[table] (columns)
select [oldDB].[table].[columns]
from [newDB].[table]

If you upgraded MVC version, the password hash might not be compatible.

如果升级了MVC版本,则密码哈希可能不兼容。

Lastly, you should be able to work around it by altering the password requirements in web.config

最后,您应该能够通过更改web.config中的密码要求来解决此问题

#1


1  

Based on the assumption that you are using the same .NET MVC version. Why not skip C#, use the SQL knowledge we got from school?

基于您使用相同.NET MVC版本的假设。为什么不跳过C#,使用我们从学校获得的SQL知识?

Insert into [newDB].[table] (columns)
select [oldDB].[table].[columns]
from [newDB].[table]

If you upgraded MVC version, the password hash might not be compatible.

如果升级了MVC版本,则密码哈希可能不兼容。

Lastly, you should be able to work around it by altering the password requirements in web.config

最后,您应该能够通过更改web.config中的密码要求来解决此问题