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

"No Authentication Token Was Retrieved" Error When Logging in to Vault

Last updated on 9 December 2024

Admin

Overview

When using federated authentication, you may run into a generic error message like this:

If the error occurs only on some computers, but not on others, then your federation configuration is likely ok, and the problem is elsewhere.

Check Windows Event Viewer's Application log on the affected computer for further details. You may find these types of events from M-Files:

----------

Authentication failed.

No authentication token was retrieved.

CoDialogs.cpp, 1676, Authentication failed. (0x8004001A)

CoDialogs.cpp, 1676, No authentication token was retrieved. (0x80131600)

(M-Files 24.9.14055.3)

----------

OAuth

Authentication failed:

System.ApplicationException: No authentication token was retrieved.

   at MFiles.AuthenticationProviders.OAuth.ClientAuthentication.Authenticate(IStringDictionary credentials, IStringDictionary configuration, Boolean& cancelledByUser)

----------

Solution

Check if the log includes the following type of error whose source is .NET Runtime:

Application: DllHost.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.IO.FileNotFoundException

Exception Info: Microsoft.Web.WebView2.Core.WebView2RuntimeNotFoundException

   at Microsoft.Web.WebView2.Core.CoreWebView2Environment+<CreateAsync>d__3.MoveNext()

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)

   at MFiles.AuthenticationProviders.Common.Helper+<CreateWebView2EnvironmentAsync>d__18.MoveNext()

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)

   at MFiles.AuthenticationProviders.OAuth.AuthenticationFormWebView2+<InitializeComponentAsync>d__1.MoveNext()

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)

   at MFiles.AuthenticationProviders.OAuth.OAuthClient+<HandleAuthenticationWindow>d__159.MoveNext()

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)

   at MFiles.AuthenticationProviders.OAuth.OAuthClient+<AuthenticationThread>d__156.MoveNext()

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

   at System.Threading.ThreadPoolWorkQueue.Dispatch()

The most telling part of the error has been bolded above. This error indicates that WebView2 is not installed on the computer that is trying to log in to the vault.

M-Files uses WebView2 to render the browser window that is used to log in when using federation. If WebView2 is not installed, then the authentication window cannot be rendered, and the errors listed above are generated.

To solve the issue, install WebView2 on the computer that is experiencing the issue. At the time of writing, you can download WebView2 installer from here: 
https://developer.microsoft.com/microsoft-edge/webview2/

You may run into this issue on M-Files versions newer than 24.5, because starting from M-Files 24.6, WebView2 is no longer a part of the M-Files installer package and it needs to be installed separately. The M-Files installer mentions this requirement during the installation process, if WebView2 is not installed on the target computer. Please refer to this article for more details.

Still need help?

On this page