# MailSourceOauth2

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

Struct for OAuth2 specific external mail source data.

- **Full name:** `MFiles.MailSourceOauth2`
- **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-type"></a>`type` | [`MailSourceOauth2Type`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.MailSourceOauth2Type/index.md) | 1 | OAuth2 service to use. Values: `MAIL_SOURCE_OAUTH2_TYPE_NONE` (0), `MAIL_SOURCE_OAUTH2_TYPE_MICROSOFT_OAUTH2` (1), `MAIL_SOURCE_OAUTH2_TYPE_GOOGLE_OAUTH2` (2). |
| <a id="f-status"></a>`status` | [`MailSourceOauth2Status`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.MailSourceOauth2Status/index.md) | 2 | Authentication status. Values: `MAIL_SOURCE_OAUTH2_STATUS_NONE` (0), `MAIL_SOURCE_OAUTH2_STATUS_ERROR` (1), `MAIL_SOURCE_OAUTH2_STATUS_AUTHENTICATED` (2), `MAIL_SOURCE_OAUTH2_STATUS_EXPIRED` (3). |
| <a id="f-user_info"></a>`user_info` | `string` | 3 | Information about the authenticated user (account name etc.). |
| <a id="f-configuration"></a>`configuration` | `string` | 4 | Configuration for authentication in JSON format as name-value pairs. Use names as defined in OAuth2 standard. |
| <a id="f-token_cache"></a>`token_cache` | `bytes` | 5 | Token cache. For Google OAuth2 this is in JSON format. For MSAL this is in its internal binary format. |
| <a id="f-proxy_address"></a>`proxy_address` | `string` | 6 | Proxy address if used. |

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

## Used in fields

- [`MailSource.mail_source_oauth2`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.MailSource/index.md#f-mail_source_oauth2): OAuth2 specific data.
- [`Oauth2NotificationSettings.mail_source`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Oauth2NotificationSettings/index.md#f-mail_source): OAuth2 specific data.
