Click or drag to resize

VGMembershipUserChangePasswordQuestionAndAnswer Method (String, String)

Updates the password question and answer for the membership user in the Visual Guard repository

Namespace:  Novalys.VisualGuard.Security.Membership
Assembly:  Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2019.0.101.19 (2019.0.0101.19)
Syntax
public bool ChangePasswordQuestionAndAnswer(
	string newPasswordQuestion,
	string newPasswordAnswer
)

Parameters

newPasswordQuestion
Type: SystemString
The new password question value for the membership user.
newPasswordAnswer
Type: SystemString
The new password answer value for the membership user.

Return Value

Type: Boolean
true if the update was successful; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullExceptionpassword is null

or

newPasswordQuestion is null and the RequiresQuestionAndAnswer is set to true.

or

newPasswordAnswer is null and newPasswordQuestion is not null or empty.
ArgumentExceptionpassword or newPasswordAnswer is longer than 64 characters.

or

newPasswordQuestion is empty or longer than 256 characters

or

newPasswordQuestion is empty or null and the repository property "Requires Question And Answer" is set to true.

Remarks

The password answer check is case sensitive. We strongly recommend to store the password answer as a lowered string and provide a lowered value of the password answer when you want to reset the password by using the password question and answer.

<para>
            user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())
            </para><para>
            user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())
            </para>
See Also