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

# CreateUser

> Die CreateUser-Methode in der ABBYY FlexiCapture-Benutzerverwaltungs-API erstellt einen Benutzer anhand von Name, Kennwort-Hash, E-Mail und Mandant und gibt die neue Benutzer-ID zurück.

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

Erstellt einen neuen Benutzer.

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

```
int CreateUser( string userName, string fullName, string password, string email, string tenantName );
```

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

| **Name**   | **Type** | **Beschreibung**             |
| ---------- | -------- | ---------------------------- |
| userName   | string   | Benutzername                 |
| fullName   | string   | Vollständiger Benutzername   |
| password   | string   | Benutzer-Kennwort-Hash       |
| email      | string   | E-Mail-Adresse des Benutzers |
| tenantName | string   | Name des Tenants             |

Beispielcode zum Berechnen des Kennwort-Hashs:

```
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>

| **Typ** | **Beschreibung** |
| ------- | ---------------- |
| int     | Benutzer-ID      |

<Note>
  Ein T-SQL-Code zur Überprüfung, ob das Kennwort korrekt verschlüsselt wurde:
</Note>

```
Select Convert( nvarchar(255), HASHBYTES( 'SHA2_256', N'myPassword' + Convert( nvarchar(64), HASHBYTES('SHA2_256', UPPER(name) ), 2) ), 2)
```
