Chage error message to check password policy in System.Web.Security.MembershipProvider (EPiServer)

here is my case.

I am using EPiServer 9 and I have configured SqlServerMembershipProvider as follows:

<add name="SqlServerMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                     connectionStringName="EPiServerXYZ"
                     enablePasswordRetrieval="false"
                     enablePasswordReset="true"
                     requiresQuestionAndAnswer="false"
                     requiresUniqueEmail="false"
                     maxInvalidPasswordAttempts="5"
                     minRequiredPasswordLength="8"
                     minRequiredNonalphanumericCharacters="1"
                     passwordAttemptWindow="10"
                     applicationName="/"
                     passwordStrengthRegularExpression="^.*(?=.{8,})(?=.*\d)(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[^\w\d\s]).*$" />

Everything works fine, checks and various scripts.

Our problem is that the error message displayed by the membership provider is created using the configuration, and it ends up not supporting user-friendly messages, such as:

  • 'Invalid password, minimum length: 8, minimum non-alphanumeric characters: 1'
  • 'The letter numbers in "newPassword" must be greater than or equal to "1". Parameter Name: newPassword '
  • ' "newPassword" , . : newPassword '

checking password error message when creating user in episerver

, , , .

, , - / , , , , - , , / .

!

+4
1

.

div , , . . .

/ , , .

.

0

Source: https://habr.com/ru/post/1656715/


All Articles