# Credentials

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

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

User name and password for `AUTH_DATA_TYPE_CREDENTIALS`. Sent as plain text, so use TLS.

- **Full name:** `MFiles.Credentials`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-username"></a>`username` | `string` | 1 | The login account name. Required; empty fails with `E_INVALIDARG`. For Windows accounts it may include the domain as `DOMAIN\user`. |
| <a id="f-password"></a>`password` | `string` | 2 | The password as entered. |
| <a id="f-domain"></a>`domain` | `string` | 3 | Windows accounts only. When empty, the domain is taken from `username`, then from the server's domain, then the server computer's local accounts are used. |
| <a id="f-type"></a>`type` | [`CredentialsType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.CredentialsType/index.md) | 4 | The kind of account. `CREDENTIALS_TYPE_MFILES` for M-Files accounts, `CREDENTIALS_TYPE_WINDOWS` for Windows accounts; `CREDENTIALS_TYPE_AUTOMATIC` (and the unset value) tries M-Files first, then Windows. Values: `CREDENTIALS_TYPE_UNINITIALIZED` (0), `CREDENTIALS_TYPE_MFILES` (1), `CREDENTIALS_TYPE_WINDOWS` (2), `CREDENTIALS_TYPE_AUTOMATIC` (3). |

<a id="used-in-fields"></a>

## Used in fields

- [`AuthDataClientUnion.credentials`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#f-credentials): User name and password (`AUTH_DATA_TYPE_CREDENTIALS`). Completes in one call.
