ASP.NET – System.Web.Security.MembershipProvider (EPIServer) CHAGE error message in password policy verification

This is my situation.

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

 connectionStringName="EPiServerXYZ"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
applicationName="/"
passwordStrengthRegularExpression="^.*(?=. {8,})(?=.*\d)(?=.*?[AZ])(?=.*?[az])(?=.*?[^\w\d\s]). *$" />

Everything is fine, validation and different scenarios.

Our problem is that the error message displayed by the membership provider is created by using the configuration and will not give in the end A user-friendly message, such as:

>’password is invalid, minimum length: 8, minimum non-alphanumeric characters: 1′
>The non-alphanumeric characters in “newPassword’ need to be greater than or equal to ‘1’. Parameter name: newPassword’
>’The parameter’newPassword’ does not match the regular expression specified in the configuration file. Parameter name: newPassword’

error message password validation when creating user in episerver

I am happy to set up a custom error message, which will truly inform the user Explains all the requirements that we use to verify passwords in regular expressions.

So far, the only way I can think of is to implement/extend the current provider we are using so that there is a problem with verification When setting a custom error message, but I think there may be another better/easier way to do this.

Thanks in advance!

I agree with your idea of ​​customizing error messages.

Consider displaying a div with a UI error message that is hidden before the input error is detected. This can be located to the right of the input text box or above the submit button. The error message displayed depends on the input error detected.

For any password/confirm password input error, please define a general password error message, and then list the password input requirements listed with your question.

You can enter the username and email address Error add other error messages.

This is my situation.

I am using EPiServer 9, and I have configured a SqlServerMembershipProvider, As shown below:

 connectionStringName="EPiServerXYZ"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false "
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
minRequiredN onalphanumericCharacters="1"
passwordAttemptWindow="10"
applicationName="/"
passwordStrengthRegularExpression="^.*(?=.{8,})(?=.*\d) (?=.*?[AZ])(?=.*?[az])(?=.*?[^\w\d\s]).*$" />

Everything All are good, validated and different scenarios.

Our problem is that the error message displayed by the membership provider is created by using the configuration and will not give a user-friendly message in the end, such as:

p>

>’Password is invalid, minimum length: 8, minimum non-alphanumeric characters: 1′
>The non-alphanumeric characters in “newPassword’ need to be greater than or equal to ‘1’. Parameter name: newPassword’< br>>’Parameter’newPassword’ does not match the regular expression specified in the configuration file. Parameter name: newPassword’

error message password validation when creating user in episerver

I am happy to set up a custom error message, which truly explains to the user what we use in regular expressions All the requirements for verifying the password.

So far, the only way I can think of is to implement/extend the current provider we are using to set a custom error message when there is a problem with authentication, but I want There may be another better/easier way to do this.

Thanks in advance!

I agree with your idea of ​​customizing the error message.

Consider displaying a div containing the input detected UI error message hidden before the error. This can be located on the right side of the input text box or above the submit button. The error message displayed depends on the detected input error.

For any password/confirm password input error , Please define a general password error message, and then list the password input requirements listed with your question.

You can add other error messages for the username and email address input errors.

p>

Leave a Comment

Your email address will not be published.