# IRPCLoginsAdmin.GetPasswordHash

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Server login accounts](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/GetPasswordHash/

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Gets the encrypted password hash of an M-Files login, for copying the password to another
server with [SetPasswordHash](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/SetPasswordHash/index.md).

- **Service:** [Server login accounts](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/index.md) `MFiles.IRPCLoginsAdmin`
- **gRPC method:** `/MFiles.IRPCLoginsAdmin/GetPasswordHash`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-password-hash`
- **Request:** [`GetPasswordHashRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/GetPasswordHash/index.md#request)
- **Response:** [`GetPasswordHashResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/GetPasswordHash/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires the system administrator server role (server right `manage_logins`). Denied for
  other callers.
- The hash is encrypted with the public key the caller provides; `PASSWORD_ENCRYPTION_UNENCRYPTED`
  fails with "The parameter is incorrect.".

<a id="request"></a>

## Request: GetPasswordHashRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `password_encryption` | [`PasswordEncryption`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PasswordEncryption/index.md) | How to encrypt the hash for transit: set `PASSWORD_ENCRYPTION_AES256`. Values: `PASSWORD_ENCRYPTION_RC4` (0), `PASSWORD_ENCRYPTION_UNENCRYPTED` (1), `PASSWORD_ENCRYPTION_AES256` (2). |
| `public_key` | `bytes` | The caller's public key; the hash is encrypted with it. |
| `account_name` | `string` | The name of the account to get password hash from. |

<a id="response"></a>

## Response: GetPasswordHashResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `password_hash` | `string` | Deprecated; filled only for old clients. Use `password_info`. |
| `password_info` | [`PasswordInfo`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PasswordInfo/index.md) | The encrypted hash with its hash algorithm and salt. |
| `password_info.hash` | `string` | Password hash. |
| `password_info.hash_algorithm` | [`PasswordHashAlgorithm`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PasswordHashAlgorithm/index.md) | Password hash algorithm. Values: `PASSWORD_HASH_ALGORITHM_MD5` (0), `PASSWORD_HASH_ALGORITHM_UNDEFINED` (1), `PASSWORD_HASH_ALGORITHM_PBKDF2_WITH_SHA512_AND100000_ITERS` (2). |
| `password_info.salt` | `string` | Password salt. |
| `password_info.encryption` | [`PasswordEncryption`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PasswordEncryption/index.md) | Encryption algorithm used to protect the password hash. Values: `PASSWORD_ENCRYPTION_RC4` (0), `PASSWORD_ENCRYPTION_UNENCRYPTED` (1), `PASSWORD_ENCRYPTION_AES256` (2). |

<a id="related"></a>

## Related methods

- [SetPasswordHash](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/SetPasswordHash/index.md): Sets the password of an M-Files login from a password hash, for example one read with [GetPasswordHash](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/GetPasswordHash/index.md) on another server.
