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)
Syntaxpublic bool ChangePasswordQuestionAndAnswer(
string newPasswordQuestion,
string newPasswordAnswer
)
Public Function ChangePasswordQuestionAndAnswer (
newPasswordQuestion As String,
newPasswordAnswer As String
) As Boolean
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:
Booleantrue if the update was successful; otherwise, false.
ExceptionsException | 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. |
RemarksThe 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