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/Troubleshooting/Common problems

Authentication failed in new web connection with external users and AAD

Last updated on 9 December 2024

Admin
M-Files Web

Overview

Sometimes when external users are trying to access to a vault via new web connection via Azure AD, they get Authentication failed window.

image.png

No errors are written to the event viewer about this event. Classic Web and Desktop are working normally. Internal users can access normally via new web connection.

Solutions

There are a couple of solutions available for this issue depending on your situation.

First solution  

Check Windows event log's Authentication results. Usually results are as "Information"-events. From Authentication results listing (also referred as token contents) you will find parameter that includes the username. Set that parameter's name as the AccountClaim value in your configuration.The place for those configurations is in M-Files Admin -> Vault's Configurations -> Federated Authentication -> Configuration -> Scopes -> the relevant scope -> the relevant configuration -> Settings -> Server

When you find event log's Authentication results check for these four parameters:

• email

• upn

• preferred_username

• unique_username

For example, if you have in configuration configured:

"AccountClaim": "upn"

"AccountClaim2": "unique_name"

And from Authentication results you find only parameter unique_name = "username information". Then you should switch AccountClaim and AccounClaim2 values with each other in the server's configurations. 

After the change:

"AccountClaim": "unique_name"

"AccountClaim2": "upn"

Note: The values may vary in your setup, make sure to use the primary one for your internal users in AccountClaim.

Second solution

It is possible that the login account name in the vault does not match the name with which login attempt is done. The reason is likely how Azure AD users are synchronized and possibly missing configuration step for synchronizing guest users.

From the error messages you can see for example this kind of login account strings:

email = username@gmail.com

upn = gmail.com\live.com#username

unique_name = live.com#username@gmail.com

And the actual login account name in the vault side is:

gmail.com\username

To match the name that goes to AccountClaim2, the user name in the vault needs to be gmail.com\live.com#username. 

Here is the configuration guide to Azure AD synchronization plugin:

Configuring Azure Active Directory Synchronization Plugin (site.com)

In chapter 8 there are settings to import guest users and how to set format of the login accounts to be imported. (Point 3. In M-Files Admin.)

If you cannot get tokens that match the current user names, you may need to create new user accounts with suitable names (e.g., username@domain.com or domain.com\username as opposed to the publicEmail\provider#username). 

Still need help?