VGMembershipInstanceChangePasswordQuestionAndAnswer Method (String, String, String) |
Note: This API is now obsolete.
Namespace: Novalys.VisualGuard.Security.Membership
[ObsoleteAttribute("Use ChangePasswordQuestionAndAnswer(VGMembershipUser user, string newPasswordQuestion, string newPasswordAnswer)")] public bool ChangePasswordQuestionAndAnswer( string username, string newPasswordQuestion, string newPasswordAnswer )
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.or username is null. |
ArgumentException | username is empty or is longer than 64 characters or contains invalid chars ('\', '/', '?', '*', '%', ';', ''', '"', ':', '|', '[', ']', '+', '=', ',').
or 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. |
SecurityException | The current user does not have enough privileges to use Membership API. The Membership access level of the application must be sufficient to allows this action or the 'Membership Manager' role must be granted to the user by using the Visual Guard console. |
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())