Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

How to enable Entra ID guest accounts when using User Sync Plugin in M-Files Admin

Last updated on 1 May 2025

Admin

How to enable Entra ID guest accounts when using User Sync Plugin in M-Files Admin

Created: 22-Nov-2023, Last updated: 29-Apr-2025

Overview

Sometimes you need to import guest users from your Entra ID (ex-Azure AD) tenant to M-Files, but when importing them via the Azure AD User Sync Plugin, their login accounts in M-Files are created as M-Files logins instead of Windows logins and their Full Name and Email fields remain empty.

Solution

To import guest users correctly via the Azure AD User Sync Plugin and to authenticate them successfully, some extra configuration is required in Entra ID and in M-Files.

In Entra ID:

  1. Find the App Registration that you use to authenticate users when they log in to M-Files. If you are unsure which App Registration M-Files is connecting to, check the ClientID value from Federated Authentication configuration in M-Files Admin, then find the App Registration that has the same "Application (client) ID" in Entra ID.
  2. In the App Registration's settings, go to "Token configuration".
  3. Click "Add optional claim".
  4. Set the token type to "ID".
  5. From the list of available claims, select "upn" and click "Add".
  6. You will get a notification about API permissions. Check the checkbox and click "Add".
  7. "upn" has now appeared on the list of optional claims. Click the "..." button to the right of the "upn" claim and select Edit:
    A screenshot of a computer         Description automatically generated
  8. Enable "Externally authenticated" and click Save.

In M-Files Admin:

  1. Access the configuration of the Azure AD User Sync Plugin.
  2. Set "Import External Accounts" to No.

If your user sync plugin configuration is in the server's registry (this is an option in on-premises environments), then you need to add the following setting to the configuration:

STRING_SZ: detectExternalAccounts
Date: false

The registry-based configuration should look like this:

These changes on M-Files' side may seem counter intuitive, but they will force M-Files to import all Login accounts as Windows accounts, as opposed to importing guest accounts as M-Files logins. The Logins will also have the Full Name and Email addresses filled in. The login accounts should be imported in the following format:

tenant.onmicrosoft.com\user_domain.com#EXT# 

Even though the login accounts show up in this format in M-Files Admin, the users will still use their normal email address as their username when logging in to M-Files through Entra ID's login dialogue. The end user does not need to be aware of this exotic login account format at all.

Note: the ID tokens of the guest users might not include the same claims that have been configured for internal users in your Entra ID tenant. If the guest users can't log in to M-Files after import:

  1. Enable logging for server-side settings in the federated authentication configuration in M-Files.
  2. Ask a guest user to try to log in to M-Files. The user's ID token will be captured in M-Files server's Windows Event Viewer's Application log.
  3. Check the log to see what claims are included in the guest user's token.
  4. Pick a claim that has the guest user's login account as value with the #EXT# format mentioned above.
  5. Go into the Advanced tab of the federated authentication configuration in M-Files Admin.
  6. In the configuration JSON, add a setting called "AccountClaim2" into the Server settings and set its value to the name of the claim you picked from the guest user's ID token.

The configuration should look something like this:
A screenshot of a computer     Description automatically generated

If the guest users are still unable to log in, then review and compare the ID tokens in the logs with the actual login accounts in M-Files and make changes as necessary.

Here is an example of what the logged token's contents should look like for a guest user:

A screenshot of a computer     Description automatically generated

For additional troubleshooting suggestions, refer to Authentication failed in new web connection with external users and AAD.

Still need help?

On this page