VGSecurityRuntimeChangePasswordQuestionAndAnswer Method (String, String, String) |
Namespace: Novalys.VisualGuard.Security
public VGPasswordQuestionAndAnswerModificationState ChangePasswordQuestionAndAnswer( string name, string newQuestion, string newAnswer )
Exception | Condition |
---|---|
ArgumentNullException | The old password, the new password or the password confirmation are null. The name is null. |
ArgumentException | name, password, newAnswer is longer than 64 characters orThe newQuestion question is longer than 256 characters orThe name is empty. |
NotSupportedException | the repository does not support Visual Guard authentication mode. The name is empty. |
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.
user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())
user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())