VGMembershipUserChangePasswordQuestionAndAnswer Method (String, 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 password,
string newPasswordQuestion,
string newPasswordAnswer
)
Public Function ChangePasswordQuestionAndAnswer (
password As String,
newPasswordQuestion As String,
newPasswordAnswer As String
) As Boolean
Parameters
- password
- Type: SystemString
The current password for the membership user. - 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:
Booleantrue if the update was successful; otherwise, false.
Exceptions Exception | Condition |
---|
ArgumentNullException | password is null
or
newPasswordQuestion is null and the RequiresQuestionAndAnswer is set to true.
or
newPasswordAnswer is null and newPasswordQuestion is not null or empty.
|
ArgumentException | password 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>
<para>
user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())
</para><para>
user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())
</para>
See Also