# AuthDataServerUnion

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.AuthDataServerUnion/

The method-specific part of `AuthDataServer`; the member matches `AuthDataServer.type`.

- **Full name:** `MFiles.AuthDataServerUnion`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)
- **Nested types:** [`AuthDataServerUnion.UndefinedServerData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-UndefinedServerData), [`AuthDataServerUnion.MFilesLeg1Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-MFilesLeg1Data), [`AuthDataServerUnion.MFilesLeg2Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-MFilesLeg2Data), [`AuthDataServerUnion.WindowsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-WindowsData), [`AuthDataServerUnion.PluginData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-PluginData), [`AuthDataServerUnion.CredentialsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-CredentialsData), [`AuthDataServerUnion.AnonymousData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-AnonymousData)

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-mfiles_leg1"></a>`mfiles_leg1` | [`AuthDataServerUnion.MFilesLeg1Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-MFilesLeg1Data) (oneof data) | 1 | The challenge, hash algorithm and salt of the M-Files challenge login. |
| <a id="f-mfiles_leg2"></a>`mfiles_leg2` | [`AuthDataServerUnion.MFilesLeg2Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-MFilesLeg2Data) (oneof data) | 2 | Reply to the second step of the M-Files challenge login; has no data. |
| <a id="f-windows"></a>`windows` | [`AuthDataServerUnion.WindowsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-WindowsData) (oneof data) | 3 | The next Windows authentication token and whether the exchange is complete. |
| <a id="f-plugin"></a>`plugin` | [`AuthDataServerUnion.PluginData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-PluginData) (oneof data) | 4 | The plug-in's output and whether it has finished. |
| <a id="f-credentials"></a>`credentials` | [`AuthDataServerUnion.CredentialsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-CredentialsData) (oneof data) | 5 | Reply to a user name and password login; has no data. |
| <a id="f-anonymous"></a>`anonymous` | [`AuthDataServerUnion.AnonymousData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServerUnion/index.md#t-AnonymousData) (oneof data) | 6 | Reply to an anonymous login; has no data. |

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

## Used in fields

- [`AuthDataServer.data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataServer/index.md#f-data): Method-specific reply: a challenge, a token to pass on, or nothing.

<a id="t-UndefinedServerData"></a>

## Nested message UndefinedServerData

Not used by any authentication method; the server never returns it.

Full name: `MFiles.AuthDataServerUnion.UndefinedServerData`

No fields.

<a id="t-MFilesLeg1Data"></a>

## Nested message MFilesLeg1Data

The challenge of the M-Files challenge login, answered with
`AuthDataClientUnion.MFilesLeg2Data`.

Full name: `MFiles.AuthDataServerUnion.MFilesLeg1Data`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-MFilesLeg1Data-challenge"></a>`challenge` | `bytes` | 1 | The challenge to answer in the second step. |
| <a id="t-MFilesLeg1Data-password_hash_algorithm"></a>`password_hash_algorithm` | [`PasswordHashAlgorithm`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PasswordHashAlgorithm/index.md) | 2 | The algorithm the account's password is stored with. Values: `PASSWORD_HASH_ALGORITHM_MD5` (0), `PASSWORD_HASH_ALGORITHM_UNDEFINED` (1), `PASSWORD_HASH_ALGORITHM_PBKDF2_WITH_SHA512_AND100000_ITERS` (2). |
| <a id="t-MFilesLeg1Data-password_salt"></a>`password_salt` | `string` | 3 | The salt for hashing the password with `password_hash_algorithm`. |

<a id="t-MFilesLeg2Data"></a>

## Nested message MFilesLeg2Data

Reply to the second step of the M-Files challenge login. Has no data.

Full name: `MFiles.AuthDataServerUnion.MFilesLeg2Data`

No fields.

<a id="t-WindowsData"></a>

## Nested message WindowsData

One step of a Windows (SSPI) authentication exchange.

Full name: `MFiles.AuthDataServerUnion.WindowsData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-WindowsData-auth_data"></a>`auth_data` | `bytes` | 1 | Opaque Windows authentication data. |
| <a id="t-WindowsData-is_done"></a>`is_done` | `bool` | 2 | True when the login process has been completed. |

<a id="t-PluginData"></a>

## Nested message PluginData

The plug-in's reply in a plug-in login.

Full name: `MFiles.AuthDataServerUnion.PluginData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-PluginData-auth_data"></a>`auth_data` | repeated [`NamedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValue/index.md) | 1 | The plug-in's output as named values, to process before the next call. |
| <a id="t-PluginData-is_done"></a>`is_done` | `bool` | 2 | True when the plug-in has finished authenticating. |

<a id="t-CredentialsData"></a>

## Nested message CredentialsData

Reply to a user name and password login. Has no data.

Full name: `MFiles.AuthDataServerUnion.CredentialsData`

No fields.

<a id="t-AnonymousData"></a>

## Nested message AnonymousData

Reply to an anonymous login. Has no data.

Full name: `MFiles.AuthDataServerUnion.AnonymousData`

No fields.
