Login and sessions (IRPCLogin)

View as Markdown

An interface for handling client login & logout operations.

Use this interface to log in to MFServer and to maintain the login session.

gRPC serviceMFiles.IRPCLogin
Book and levelVault API, core
Methods25
Proto filemfiles/IRPCLogin.proto

Overview

Opens, maintains and closes sessions. Almost every other call needs the session ID that LogIn returns, sent as the binary metadata header mfiles-session-id-bin (the 48 bytes of session_data.session_id, unchanged).

Which methods matter:

Job Methods
Find out how to authenticate GetServerCapabilities, GetAuthenticationConfiguration
Open a session LogIn (vault or server level), LogInWithSession (another vault, same user)
Keep it open KeepAlive, at least every session_data.keep_alive_interval_in_seconds
Close it LogOut
Inspect it GetVaultSessionInfo

Typical order:

  1. QueryVersion and GetServerCapabilities (no session needed).
  2. GetAuthenticationConfiguration when the vault may use single sign-on; AUTH_METHOD_PLUGIN means log in with AUTH_DATA_TYPE_PLUGIN, otherwise use user name and password (AUTH_DATA_TYPE_CREDENTIALS).
  3. LogIn with the vault GUID. Keep session_data.
  4. Call KeepAlive on a timer while the session is in use.
  5. On UNAUTHENTICATED, log in again with LogIn and continue with the new session ID.
  6. LogOut when done. A session that is not logged out holds its license until it times out.

A session is bound to one vault, or to no vault (a server-level session, opened with the vault GUID {00000000-0000-0000-0000-000000000000}). Methods that need a vault fail with E_MFILES_LOGIN_REQUIRED when called with a server-level session.

Errors: an invalid, expired or missing session is reported as gRPC status UNAUTHENTICATED with no error trailers. All other failures, including a wrong password, use status UNKNOWN with the M-Files error stack in the mfiles-error-serialized-bin trailer.

Other methods of this service serve M-Files' own clients (licensing warnings, password encryption, client settings, replication) and are marked as such.

Guides: Authentication and sessions covers every login type and the session lifecycle, and Call metadata the headers that every call sends.

Highlighted methods

MethodSummaryFacts
GetServerCapabilitiesGets the features the server supports, without logging in.session no session idempotent
GetAuthenticationConfigurationTells a client, before login, whether to authenticate with an authentication plug-in (single sign-on) and returns the plug-in's client-side configuration.session no session idempotent
LogInAuthenticates the caller and opens a session to a vault, or to the server when the vault GUID is all zeros.session no session
LogInWithSessionOpens a new session to a vault (or the server) for the user of an existing session, without authenticating again.session session
KeepAliveTells the server that the session is still in use, so that it does not expire.session session idempotent
LogOutEnds the session and releases its license.session session
GetVaultSessionInfoGets basic information about the current vault session: server version and ID, vault GUID and name, and the state of the server push channel.session session returns metadata structure version

Other methods

MethodSummaryFacts
ChangePasswordChanges the M-Files password of the logged-in account.session session
CreateUserSessionOpens a session that acts as another user of the vault.session session idempotent
DisconnectDeviceRemoves a device registration (device token) of the logged-in user in the session's vault.session session
GetAuthenticationPluginsLists the authentication plug-ins installed on the server, without their configurations.session no session
GetClientSettingsByTypeGets client settings (theme, timeouts, banners, web security settings) for an M-Files web, desktop or Outlook client.session no session
GetLicenseExpirationInfoGets the number of days until the server's license and its subscription expire.session session idempotent
GetLoginSettingsGets the anonymous login settings and enabled vertical applications of the vault that serves the given host name, without a session.session no session
GetPublicKeyGets the server's RSA public key, for encrypting secrets that a client sends to the server.session session idempotent
GetPublicKeyAnonymousGets the server's RSA public key without a session, for encrypting authentication data before login.session no session
GetRPCOverCOMInterfaceGets RPC over COM interface for accessing M-Files Server.session no session
GetVaultConnectionInfoGets the full connection information of the current vault session, in the form the M-Files COM API uses.session session
IsServerRunningInEvaluationModeTells whether the server runs on an evaluation license, and how many evaluation days are left.session session idempotent
LoginForAutomaticUpdatesLogs in for automatic updates.session no session
LogInRemoteLogs in (with authentication) to a remote server.session no session
ReloginLogs in again by using the current session ID. Used by M-Files' own clients.session session
ResolveMaturityOfFeatureReturns which of the named server feature flags are enabled on this server.session no session
SetOpenSessionCheckSets whether administrators are warned about this session when they take the vault offline or do other maintenance.session session
VerifyLicenseSubscriptionTimeFails if the server's license subscription has expired; succeeds otherwise.session no session