Visual Guard Class Library Documentation

VGSecurityRuntime.ChangePasswordQuestionAndAnswer Method 

Changes the password question and answer of the user.

public VGPasswordQuestionAndAnswerModificationState ChangePasswordQuestionAndAnswer(
   String name,
   String password,
   String newQuestion,
   String newAnswer
);

Parameters

name
the name of the user.
password
the password of the given user.
newQuestion
The new password question of the user as string.
newAnswer
The new answer of the given password question as string.

Return Value

A 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.

user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())

user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())

Exceptions

Exception TypeCondition
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

or

The newQuestion question is longer than 256 characters

or

The name is empty.

NotSupportedException

the repository does not support Visual Guard authentication mode.

The name is empty.

See Also

VGSecurityRuntime Class | Novalys.VisualGuard.Security Namespace