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

# ValidateUser

> Die ValidateUser-Methode in der API zur Benutzerverwaltung von ABBYY FlexiCapture überprüft, ob ein Benutzername und der Kennwort-Hash mit den gespeicherten Anmeldedaten übereinstimmen, und enthält ein Beispiel für die Hash-Berechnung.

<div id="what-it-does">
  ## Funktion
</div>

Prüft, ob Benutzername und Kennwort mit den in der Datenbank gespeicherten Werten übereinstimmen.

<div id="definition">
  ## Definition
</div>

```
bool ValidateUser( string userName, string passwordHash );
```

<div id="parameters">
  ## Parameter
</div>

| **Name**     | **Typ** | **Beschreibung** |
| ------------ | ------- | ---------------- |
| userName     | string  | Benutzername     |
| passwordHash | string  | Kennwort-Hash    |

Beispielcode zum Berechnen des Kennwort-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;
        }
```

<div id="returned-value">
  ## Rückgabewert
</div>

<table width="100%"><tbody><tr><td><p><strong>Typ</strong></p></td><td><p><strong>Beschreibung</strong></p></td></tr><tr><td><p>bool</p></td><td><ul><li>"true", wenn die Werte übereinstimmen</li><li>andernfalls "false"</li></ul></td></tr></tbody></table>
