> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ChangePassword

> ChangePassword method in the ABBYY FlexiCapture user management API resets a user password, with sample code for computing the salted SHA-256 password hash.

## What it does

Resets a user's password.

## Definition

```
bool ChangePassword( string userName, string oldPassword, string newPassword );
```

## Parameters

| **Name**    | **Type** | **Description**                  |
| ----------- | -------- | -------------------------------- |
| userName    | string   | User name                        |
| oldPassword | string   | Old password value (unencrypted) |
| newPassword | string   | New password value               |

Sample code for calculating the password hash:

```
public static string GetPasswordHashWithSalt( string login, string password )
        {
            string salt = GetPasswordSha256Hash(login.ToUpper());
            return GetPasswordSha256Hash(password + salt);
        }
        private static string GetPasswordSha256Hash( string password )
        {
            Encoding enc = Encoding.GetEncoding("UTF-16");
            byte[] buffer = enc.GetBytes(password);
            var cryptoTransformSHA256 = new SHA256CryptoServiceProvider();
            string hash = BitConverter.ToString(cryptoTransformSHA256.ComputeHash(buffer)).Replace("-", "");
            return hash;
        }
```

## Returned value

<table width="100%"><tbody><tr><td><p><strong>Type</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p>bool</p></td><td><ul><li>"false" if the password has not been reset. For example, the old password didn't match the new password</li><li>"true" if the password has been successfully reset</li></ul></td></tr></tbody></table>
