# AuthDataClientUnion

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

The method-specific part of `AuthDataClient`. Set the member that `AuthDataClient.type` names.

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

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

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-mfiles_leg1"></a>`mfiles_leg1` | [`AuthDataClientUnion.MFilesLeg1Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#t-MFilesLeg1Data) (oneof data) | 1 | First call of the two-step M-Files challenge login (`AUTH_DATA_TYPE_MFILES_LEG1`). |
| <a id="f-mfiles_leg2"></a>`mfiles_leg2` | [`AuthDataClientUnion.MFilesLeg2Data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#t-MFilesLeg2Data) (oneof data) | 2 | Second call of the two-step M-Files challenge login (`AUTH_DATA_TYPE_MFILES_LEG2`). |
| <a id="f-windows"></a>`windows` | [`AuthDataClientUnion.WindowsData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#t-WindowsData) (oneof data) | 3 | Windows authentication tokens (`AUTH_DATA_TYPE_WINDOWS`), possibly over several calls. |
| <a id="f-plugin"></a>`plugin` | [`AuthDataClientUnion.PluginData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#t-PluginData) (oneof data) | 4 | Authentication through a plug-in such as single sign-on (`AUTH_DATA_TYPE_PLUGIN`). |
| <a id="f-credentials"></a>`credentials` | [`Credentials`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Credentials/index.md) (oneof data) | 5 | User name and password (`AUTH_DATA_TYPE_CREDENTIALS`). Completes in one call. |
| <a id="f-anonymous"></a>`anonymous` | [`AuthDataClientUnion.AnonymousData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClientUnion/index.md#t-AnonymousData) (oneof data) | 6 | Anonymous login (`AUTH_DATA_TYPE_ANONYMOUS`), when the vault allows it. Has no data. |

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

## Used in fields

- [`AuthDataClient.data`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthDataClient/index.md#f-data): The method's data. Set exactly the member that `type` names.

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

## Nested message UndefinedClientData

Not used by any authentication method; never set it.

Full name: `MFiles.AuthDataClientUnion.UndefinedClientData`

No fields.

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

## Nested message MFilesLeg1Data

First step of the M-Files challenge login: names the account and asks for a challenge.

Full name: `MFiles.AuthDataClientUnion.MFilesLeg1Data`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-MFilesLeg1Data-user_name"></a>`user_name` | `string` | 1 | M-Files user name. |

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

## Nested message MFilesLeg2Data

Second step of the M-Files challenge login: answers the challenge from the first step.

Full name: `MFiles.AuthDataClientUnion.MFilesLeg2Data`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-MFilesLeg2Data-authentication_attempt_identifier"></a>`authentication_attempt_identifier` | [`AuthenticationAttemptIdentifier`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthenticationAttemptIdentifier/index.md) | 1 | The identifier returned by the first step, unchanged. |
| <a id="t-MFilesLeg2Data-response"></a>`response` | `bytes` | 2 | The answer to the challenge from `AuthDataServerUnion.MFilesLeg1Data`. |

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

## Nested message WindowsData

One step of a Windows (SSPI) authentication exchange.

Full name: `MFiles.AuthDataClientUnion.WindowsData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-WindowsData-authentication_attempt_identifier"></a>`authentication_attempt_identifier` | [`AuthenticationAttemptIdentifier`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthenticationAttemptIdentifier/index.md) | 1 | Unset in the first call; in later calls, the identifier from the previous response. |
| <a id="t-WindowsData-auth_data"></a>`auth_data` | `bytes` | 2 | Opaque Windows authentication data. |

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

## Nested message PluginData

Authentication through a server plug-in, for example single sign-on with an identity provider.

Take `plugin_name` and `configuration_scope` from the `PluginInfo` that
[GetAuthenticationConfiguration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetAuthenticationConfiguration/index.md)
returned. A missing `configuration_scope` fails with `E_INVALIDARG`. What `auth_data` must contain
depends on the plug-in.

Full name: `MFiles.AuthDataClientUnion.PluginData`

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="t-PluginData-authentication_attempt_identifier"></a>`authentication_attempt_identifier` | [`AuthenticationAttemptIdentifier`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AuthenticationAttemptIdentifier/index.md) | 1 | Unset in the first call; in later calls, the identifier from the previous response. |
| <a id="t-PluginData-plugin_name"></a>`plugin_name` | `string` | 2 | The `name` of the plug-in configuration from `PluginInfo`. |
| <a id="t-PluginData-configuration_scope"></a>`configuration_scope` | `string` | 3 | The `Scope` value from `PluginInfo.system_configuration`. Required. |
| <a id="t-PluginData-vault_guid"></a>`vault_guid` | `string` | 6 | The vault that stores the plug-in configuration (`VaultGUID` in `PluginInfo.system_configuration`), if any. |
| <a id="t-PluginData-data_format"></a>`data_format` | [`PluginAuthDataFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.PluginAuthDataFormat/index.md) | 4 | `PLUGIN_AUTH_DATA_FORMAT_UNENCRYPTED` (the default) or `PLUGIN_AUTH_DATA_FORMAT_RSA2048`. `PLUGIN_AUTH_DATA_FORMAT_RSA512` is refused. Values: `PLUGIN_AUTH_DATA_FORMAT_UNENCRYPTED` (0), `PLUGIN_AUTH_DATA_FORMAT_RSA512` (1), `PLUGIN_AUTH_DATA_FORMAT_RSA2048` (2). |
| <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) | 5 | The plug-in's input as named values, for example the token from the identity provider. Non-empty values are encrypted when `data_format` says so. |

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

## Nested message AnonymousData

Anonymous login. Has no data.

Full name: `MFiles.AuthDataClientUnion.AnonymousData`

No fields.
