# IRPCLogin.LogInWithSession

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md)

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

Badges: `Vault API / core` `session` `session`

Opens a new session to a vault (or the server) for the user of an existing session, without
authenticating again.

- **Service:** [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md) `MFiles.IRPCLogin`
- **gRPC method:** `/MFiles.IRPCLogin/LogInWithSession`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/log-in-with-session`
- **Request:** [`LogInWithSessionRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/LogInWithSession/index.md#request)
- **Response:** [`LogInWithSessionResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/LogInWithSession/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** session
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

Send the existing session in `mfiles-session-id-bin`; it can be a server-level or a vault session.
The response carries a new session with its own session ID; the original session stays valid and
must be logged out separately.

The typical use is: `LogIn` once at server level, list vaults with
[GetVaults](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/GetVaults/index.md), then open one session per vault with this method.
The user must have access to the target vault. If `client_data.language` is empty the language of
the existing session is used. `login_data.vault_guid` follows the rules of
[LogIn](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/LogIn/index.md): the all-zero GUID opens a server-level session.

An offline vault is refused with `E_MFILES_VAULT_OFFLINE`, except for an administrative login that
the server allows during maintenance.

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

## Request: LogInWithSessionRequest

> 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 |
|---|---|---|
| `client_data` | [`ClientData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ClientData/index.md) | Describes the client software, as in `LogIn`. |
| `client_data.version` | `uint64` | The client's version, packed like `QueryVersionResponse.server_version` (`major << 48 \| minor << 32 \| build << 16 \| patch`). May be 0. If the server administrator has set a minimum client version, older clients are refused with `E_MFILES_INCOMPATIBLE_SERVER_VERSION`. |
| `client_data.capabilities` | [`ClientCapabilities`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ClientCapabilities/index.md) | Features the client software handles. The server adapts some responses to them, so set only the flags your code implements; leave the rest false. |
| `client_data.capabilities.property_def_searchability` | `bool` | Property definitions can be configured searchable or unsearchable. |
| `client_data.capabilities.unmanaged_objects` | `bool` | Client understands unmanaged objects. |
| `client_data.capabilities.extension_authentication_data_push` | `bool` | Client supports data push for extension authentications. |
| `client_data.capabilities.custom_api_data_push` | `bool` | Client supports server data push for M-Files API & custom implementations. |
| `client_data.capabilities.unknown_file_size` | `bool` | Client can handle unknown or estimated file size. |
| `client_data.capabilities.typed_metadata_suggestions` | `bool` | Client can handle metadata suggestions to all M-Files types. |
| `client_data.capabilities.long_authentication_attempt_identifier` | `bool` | The client handles the long (32-byte) authentication attempt identifier in `AuthenticationAttemptIdentifier.data`. |
| `client_data.capabilities.reverse_grouping_level` | `bool` | Client supports reverse grouping levels. |
| `client_data.capabilities.object_permissions_for_client` | `bool` | Client supports ObjectPermissionsForClient. |
| `client_data.capabilities.hierarchical_object_type_properties` | `bool` | Properties with hierarchy for real object types supported. |
| `client_data.capabilities.smart_search` | `bool` | Client supports Smart Search engine type. |
| `client_data.capabilities.recurring_notifications` | `bool` | Client supports recurring notifications. |
| `client_data.capabilities.smart_search_facets` | `bool` | Client supports smart search facets. |
| `client_data.capabilities.vault_role_manage_private_views` | `bool` | Client supports a vault role for managing private views. |
| `client_data.capabilities.allow_all_see_deleted_conflict_objects` | `bool` | Client supports that all users can see deleted conflict objects. |
| `client_data.capabilities.advanced_password_hashes` | `bool` | Client supports hashing passwords with advanced algorithms, including at least PBKDF2. |
| `client_data.capabilities.anonymous_authentication` | `bool` | Client supports anonymous authentication. |
| `client_data.capabilities.dataset_deleted_condition` | `bool` | Client supports deleted/not deleted-condition in a dataset definition. |
| `client_data.capabilities.unified_password_hashes` | `bool` | Client supports transmitting hashing passwords with the same encoding between all gRPC methods. |
| `client_data.capabilities.duplicates_view` | `bool` | Client supports the duplicates view. |
| `client_data.capabilities.property_action_state_transition_time` | `bool` | Client supports state transition time setting via state property action. |
| `client_data.capabilities.at_mentions` | `bool` | Client supports the @mentions in comment texts. |
| `client_data.capabilities.additive_permissions_via_automatic_aclcomponents` | `bool` | Client supports additive permissions via automatic ACL components. |
| `client_data.capabilities.vault_level_optimization_jobs` | `bool` | Client supports vault-level optimization jobs. |
| `client_data.capabilities.visitor_links_supported` | `bool` | Client supports new interface methods for visitor links. |
| `client_data.capabilities.object_type_filter_multi_select_views` | `bool` | Client supports multiple object types as a filter for views and advanced searches. |
| `client_data.capabilities.generate_v2_azure_auth_conf_supported` | `bool` | Client supports generating authentication configuration for Azure v2.0 endpoint. |
| `client_data.capabilities.structure_item_groups_in_export` | `bool` | Client supports structure item groups in the export job. |
| `client_data.capabilities.aino_search` | `bool` | Client supports Aino Search engine type. |
| `client_data.capabilities.conversation_history` | `bool` | Client supports conversation history. |
| `client_data.capabilities.generate_login_service_auth_conf` | `bool` | Client supports generating authentication configuration for M-Files Login Service. |
| `client_data.capabilities.sub_folders_in_views` | `bool` | Client supports subfolders in views. |
| `client_data.capabilities.reverse_references_in_pseudo_user_aces` | `bool` | Client supports reverse references in pseudo-user ACEs (Access Control Entries). |
| `client_data.capabilities.entity_version_checking_supported` | `bool` | Client supports entity version numbering to track modification conflicts. |
| `client_data.capabilities.workflow_descriptions_supported` | `bool` | Client supports workflow descriptions. |
| `client_data.capabilities.property_value_metadata_supported` | `bool` | Client supports setting and retrieving property value metadata. |
| `client_data.capabilities.object_type_grouping_for_relationships` | `bool` | Client supports object type based grouping for relationships. |
| `client_data.capabilities.draft_objects` | `bool` | Client supports draft objects in discovery results. |
| `client_data.language` | `string` | The client's language, for example `en`. For [LogInWithSession](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/LogInWithSession/index.md), empty means the language of the existing session. |
| `client_data.type` | [`ClientType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ClientType/index.md) | The kind of client. Applications use `CLIENT_TYPE_SERVER_API`. |
| `client_data.type_specifier` | `string` | Optional free-form name of the client application. |
| `login_data` | [`LoginData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.LoginData/index.md) | The target vault (`vault_guid`) and session options. |
| `login_data.server_hostname` | `string` | The host name the client used to reach the server. Optional for user name and password logins. Anonymous logins, and server-level logins on servers with vault login accounts, use it to find the vault configured for that host name. |
| `login_data.vault_guid` | `string` | The vault to log in to, as a GUID string with or without braces, in any case. Use `{00000000-0000-0000-0000-000000000000}` for a server-level session; an empty string is rejected with `E_MFILES_INVALID_VAULT_GUID_X_DESC`. |
| `login_data.is_administrative` | `bool` | True for administrative tools that manage the vault rather than work with documents, as M-Files Admin does. Applications leave it false. |
| `login_data.client_session_timeout_in_seconds` | `uint32` | Optional. Requests a longer idle timeout for a vault session. Honored only when it is at least the server's session timeout and at most 7 days (or the server timeout if that is longer); otherwise, and for server-level sessions, the server timeout applies. The effective value shows as `SessionData.keep_alive_interval_in_seconds`, which is half of it. |

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

## Response: LogInWithSessionResponse

> Nested message fields are expanded to depth 2 only, to keep the page small (the full expansion has more rows); follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `session_data` | [`SessionData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SessionData/index.md) | The new session. Use its `session_id` for calls to the target vault. |
| `session_data.session_id` | `bytes` | The session ID (48 bytes). Send it unchanged in the `mfiles-session-id-bin` metadata header of every call that needs a session. |
| `session_data.account_name` | `string` | The login account name, with the case stored on the server. |
| `session_data.access_rights` | [`SessionAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SessionAccess/index.md) | What the session may do on server level and in the vault, regardless of object permissions. |
| `session_data.server_vault_capabilities` | [`ServerVaultCapabilities`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerVaultCapabilities/index.md) | Capabilities of the server and, for vault sessions, the vault, as they apply to this user. More precise than [GetServerCapabilities](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/GetServerCapabilities/index.md). |
| `session_data.locale` | `uint32` | The Windows locale ID used for sorting, for example 1033. |
| `session_data.keep_alive_interval_in_seconds` | `uint32` | Call [KeepAlive](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/KeepAlive/index.md) at least this often. It is half of the session's idle timeout. |
| `session_data.use_strict_set_equality_comparison` | `bool` | If false, not equal type comparisons are performed in pre-MF11 style in which it is enough that at least one of the left-side values does not match any of the right-side values in order to treat the left and right values unequal. If true, none of the left-side values can match any of the right-side values in order to treat the left and right values unequal i.e. pure set-based exclusion. Prefer using the new comparison style. The old behavior is provided for compatibility reasons. |
| `session_data.product_mode` | [`ProductMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ProductMode/index.md) | The edition of the server license. Values: `PRODUCT_MODE_FULL` (0), `PRODUCT_MODE_EXPRESS` (1), `PRODUCT_MODE_BUSINESS` (2). |
| `session_data.vault_data` | [`VaultData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultData/index.md) | The user's identity in the vault. Unset for a server-level session. |
| `session_data.account_type` | [`AccountType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.AccountType/index.md) | Whether the login account is an M-Files or a Windows account. Values: `ACCOUNT_TYPE_UNINITIALIZED` (0), `ACCOUNT_TYPE_MFILES` (1), `ACCOUNT_TYPE_WINDOWS` (2). |
| `session_data.server_data` | [`ServerData`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerData/index.md) | The server's license serial number and deployment type. |
| `session_data.license_type` | [`LicenseType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.LicenseType/index.md) | The license the session uses. Values: `LICENSE_TYPE_NONE` (0), `LICENSE_TYPE_NAMED_USER_LICENSE` (1), `LICENSE_TYPE_CONCURRENT_USER_LICENSE` (2), `LICENSE_TYPE_READ_ONLY_LICENSE` (3), `LICENSE_TYPE_VISITOR_LICENSE` (4). |
| `session_data.keep_upload_session_alive_interval_in_seconds` | `uint32` | Keep a file upload session alive at least this often (half of the upload session timeout). |

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

## Related methods

- [IRPCVaults.GetVaults](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/GetVaults/index.md): Lists the vaults on the server that the session's user can see.
- [LogIn](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/LogIn/index.md): Authenticates the caller and opens a session to a vault, or to the server when the vault GUID is all zeros.
