Changes the password question and answer of the user.
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
public VGPasswordQuestionAndAnswerModificationState ChangePasswordQuestionAndAnswer( string name, string password, string newQuestion, string newAnswer ) |
Visual Basic |
---|
Public Function ChangePasswordQuestionAndAnswer ( name As String, password As String, newQuestion As String, newAnswer As String ) As VGPasswordQuestionAndAnswerModificationState |
Parameters
- name
- Type: System..::..String
the name of the user.
- password
- Type: System..::..String
the password of the given user.
- newQuestion
- Type: System..::..String
The new password question of the user as string.
- newAnswer
- Type: System..::..String
The new answer of the given password question as string.
Return Value
Type: VGPasswordQuestionAndAnswerModificationStateA VGPasswordQuestionAndAnswerModificationState representing the status of the modification.
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.
C# | Copy |
---|---|
user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant()) |
C# | Copy |
---|---|
user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant()) |
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | The old password, the new password or the password confirmation are null. The name is null. |
System..::..ArgumentException | name, password, newAnswer is longer than 64 characters orThe newQuestion question is longer than 256 characters orThe name is empty. |
System..::..NotSupportedException | the repository does not support Visual Guard authentication mode. The name is empty. |