TabularEditor icon indicating copy to clipboard operation
TabularEditor copied to clipboard

Unable to obtain authentication token using the credentials provided (2025)

Open dbeavon opened this issue 7 months ago • 3 comments

Error message when connecting to database Trying to connect with the auth mode "Windows Integrated or Azure AD login". Trying to connect to a model in a Fabric workspace, using directlake plus import tables.

When I type in my username and password everything works fine. Ideally there would be full SSO integration (like in SSMS) or at least Oauth integration with a popup user selection, like in DAX Studio.

Repro Steps to reproduce the behavior:

  1. Go to connect to a server like powerbi://api.powerbi.com/v1.0/myorg/GR-IT-DEV-MyCoolWorkspace
  2. Click on Windows Integrated or Azure AD login
  3. Click OK
  4. See error

Image

Expected behavior Would like to avoid typing user name and password every time I open a database via TE 2.26.0

Observed behavior Get an error message about failed oauth.

Application specifics

  • Tabular Editor 2.X version: 2.26.0
  • Semantic Engine used: PBI service (directlake plus import)
  • Model Compatibility Level: 1604 (PowerBI)

dbeavon avatar Jun 20 '25 15:06 dbeavon

Hi @dbeavon I'll release an update to TE2 soon, which includes the latest AS client library from Microsoft, which should fix this issue. In the mean time, if you select "Username and Password" and put a single blank space character in the Username field, while leaving password blank, it should force the MFA account selector prompt:

Image

otykier avatar Jun 23 '25 07:06 otykier

Hi @otykier We are facing a similar problem in Azure DevOps Release Pipeline, using TE 2.19 (ver. 2.19.8566.40387) in a command line.

Example of a command line script used:

$(System.DefaultWorkingDirectory)/_Artifacts.Dev/AAS/Tools/TabularEditor/TabularEditor.exe "_Artifacts.Dev\AAS\$(SSASModelNameProjectList)\$(SSASModelNameProjectList).bim" -S "_Artifacts.Dev\AAS\Automation\SSAS\UpdateConnectionString.cs" -D "$(SSASConnectionString)" "$(SSASModelNameProjectList)" -C "|ConnectionString|" "$(SSASSourceConnectionString)" -O -P -R -V -E

where a file UpdateConnectionString.cs has the following line of code: (Model.DataSources[0] as ProviderDataSource).ConnectionString = "|ConnectionString|";

There is not too much details in the log than the lines attached below:

2025-06-24T08:19:04.6432607Z ##[error]Deployment failed! Unable to obtain authentication token using the credentials provided. 2025-06-24T08:19:04.6438452Z ##[debug]Processed: ##vso[task.logissue type=error;]Deployment failed! Unable to obtain authentication token using the credentials provided. 2025-06-24T08:19:04.6439386Z ##[debug]Processed: ##vso[task.complete result=Failed;]Done. 2025-06-24T08:19:04.6730342Z ##[debug]Exit code: 1 2025-06-24T08:19:04.6781257Z ##[debug]Leaving Invoke-VstsTool. 2025-06-24T08:19:04.7053098Z ##[error]Cmd.exe exited with code '1'.

I guess that switching to a newer version of TE 2.x will not help until you release the update?

TomekZag avatar Jun 24 '25 09:06 TomekZag

tl;dr - both the workaround from above worked for me (space in username), and downgrading to 2.24 worked as well.

details -  I ran into the same issue as OP while working with a colleague. She kept running into this issue unable to connect, but I could connect. I eventually found the issues here on GH, and saw release notes for 2.26. Sure enough, she's running 2.26, and I was still on 2.24. When I upgraded to 2.26, I could easily repro the issue.

Image As soon as I hit ok on the connect dialog, it would give the error as shown by OP. thankfully I see the workaround does work, but I'm looking forward to the fix since we have to use the workaround every time we open a model.

IRun26Point2 avatar Jun 25 '25 23:06 IRun26Point2

Hi @IRun26Point2 I have updated the TE2 artifact used in DevOps Release Pipeline to version 2.24.1 (build 2.24.8878.22493), but the issue still persists. In case of deployments from the command line the workaround (Space in username) can't be used, I believe.

TomekZag avatar Jun 26 '25 11:06 TomekZag

Hi @otykier,

Any chances of getting the update to TE2 regarding this topic?

TomekZag avatar Aug 18 '25 08:08 TomekZag

Could you check if the issue is resolved in 2.27.0? Thanks!

otykier avatar Sep 24 '25 13:09 otykier

Well, now with 2.27.0 it is not possible to log in at all, and workaround with a space in username field no longer works.

ghost avatar Sep 24 '25 14:09 ghost

Are you not able to login using the “Microsoft Entra MFA” option either? What error message are you seeing in that case?

otykier avatar Sep 24 '25 14:09 otykier

@otykier choosing "Microsoft Entra MFA" yields an dialog "Could not connect to server: Unable to obtain authentication token using the credentials provided"

ghost avatar Sep 24 '25 14:09 ghost

Hi @otykier, Issue still persists when using new version 2.27 from command line in Release Pipeline. The same error message pops up: Deployment failed! Unable to obtain authentication token using the credentials provided.

TomekZag avatar Sep 24 '25 16:09 TomekZag

I can confirm the same issue, for me only downgrading to 2.25 worked for PowerBI Service Connections.

hmayer1980 avatar Sep 25 '25 06:09 hmayer1980

Hi all The situation is that these issues arise inside the (Microsoft-provided) AS client library that Tabular Editor uses to connect. Moreover, I have not been able to reproduce any of the issues reported, which obviously makes it difficult for me to debug and troubleshoot. Also, downgrading to an earlier version of the client lib (such as the one used in v. 2.25 of Tabular Editor, which some of you have reported works fine), is not an option, as that version of the client lib doesn't support newer AS features such as UDFs and Calendars.

So I'm hoping that everyone facing this issue will help me (and Microsoft) in collecting more data. It would also be helpful if you could raise support requests with Microsoft, but please frame them as "XMLA based connections using the AnalysisServices client library v. 19.104.1 fails...", as mentioning Tabular Editor in a support request usually throws off their 1st level support... 😞

Below are some additional things you can try. Don't hesitate to reach out if you have any questions!

Changing WebProxy support:

  1. Add the following environment variable to your system: MS_AS_MsalConnectivityMode and set its value to 1. This changes the way WebProxy logic works, and may solve issues arising if you're using Tabular Editor on a machine in a protected environment behind firewalls/proxies.
Image
  1. Restart Tabular Editor and attempt to connect again

Disabling WAM based authentication:

(Generally not recommended, but might be a good indicator of the underlying cause of the error)

  1. Add the following environment variable to your system: MS_AS_DisableWamBasedSSO and set its value to 1.
  2. Restart Tabular Editor and attempt to connect again

Gathering detailed log files

If none of the above work, please follow the instructions below to collect additional log files, which will be helpful to Microsoft if you raise a support ticket with them:

  1. Add the following environment variables to your system:
Name Value
MS_AS_AADAUTHENTICATOR_LOG 1
MS_AS_AADAUTHENTICATOR_LOGFILE c:\tmp\as-auth.log
MS_AS_AADAUTHENTICATOR_LOGLEVEL 4

In the example above, the folder c:\tmp must exist, but feel free to change this to any other location.

  1. Restart Tabular Editor and attempt to connect again. After closing Tabular Editor, you should see the as-auth.log in the location specified. Include this file in your support request to Microsoft.

otykier avatar Sep 25 '25 06:09 otykier

Disabling WAM (MS_AS_DisableWamBasedSSO=1) worked for me and the Entra login works. Thanks @otykier !

ghost avatar Sep 25 '25 07:09 ghost

In my case none of the provided environment variables helped in the Release Pipeline. I have raised a Support Request ticket to MS, let's see what they say.

TomekZag avatar Sep 25 '25 09:09 TomekZag

Hi @otykier,

with the latest release (2.27), using "Microsoft Entra MFA", I'm getting the error: "Could not connect to server: Unable to obtain authentication token using the credentials provided".

I followed your instructions to collect additional log files and the exception raised in the log is:

	ErrorCode: wam_runtime_init_failed
Microsoft.Identity.Client.MsalClientException: Unable to load DLL 'msalruntime_x86': The specified module could not be found. (Exception from HRESULT: 0x8007007E) See https://aka.ms/msal-net-wam#troubleshooting ---> System.DllNotFoundException: Unable to load DLL 'msalruntime_x86': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.Identity.Client.NativeInterop.API.x86.MSALRUNTIME_Startup()
   at Microsoft.Identity.Client.NativeInterop.API.x86.Startup()
   at Microsoft.Identity.Client.NativeInterop.Module.AddRef(String handleName)
   at Microsoft.Identity.Client.NativeInterop.Core..ctor()
   at Microsoft.Identity.Client.Platforms.Features.RuntimeBroker.RuntimeBroker.<>c.<.cctor>b__26_0()

I also tried to build Tabular editor from source and if I run the executable in bin\Release there are no issues: after clicking OK to connect, I get the account picker and then it works as expected.

pfab0 avatar Sep 25 '25 09:09 pfab0

Very interesting, @pfab0 - thanks for sharing that! Indeed it would seem like that DLL doesn't make it into our packaged version. Stay tuned for an updated version!

otykier avatar Sep 25 '25 09:09 otykier

I've prepared a new build which I'm hoping will have this fixed once and for all (it includes an update of the MSAL client lib and also ensures that the msalruntime dll is part of the package):

  • Installer: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.Installer.msi
  • Portable: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.zip

@pfab0, @TomekZag, could you try the above version and let me know? Thanks!

otykier avatar Sep 25 '25 09:09 otykier

I've prepared a new build which I'm hoping will have this fixed once and for all (it includes an update of the MSAL client lib and also ensures that the msalruntime dll is part of the package):

  • Installer: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.Installer.msi
  • Portable: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.zip

@pfab0, @TomekZag, could you try the above version and let me know? Thanks!

I tried the installer and it works for me.

pfab0 avatar Sep 25 '25 10:09 pfab0

@hmayer1980 @IRun26Point2 @dbeavon I would appreciate if you could also test the build provided in the links above and let me know if this also solves the problem for you. Thanks!

otykier avatar Sep 25 '25 10:09 otykier

Multiple users who were previously unable to connect have confirmed that 2.27.1 fixes the issue, so I've gone ahead and published it as a new release: https://github.com/TabularEditor/TabularEditor/releases/tag/2.27.1

Thanks, everyone, for sharing your observations! I'll close this issue, but feel free to reach out if you encounter any issues after upgrading to 2.27.1.

otykier avatar Sep 25 '25 11:09 otykier

@hmayer1980 @IRun26Point2 @dbeavon I would appreciate if you could also test the build provided in the links above and let me know if this also solves the problem for you. Thanks!

@otykier Yes, this fixed Version does work for me properly. Thanks

hmayer1980 avatar Sep 25 '25 16:09 hmayer1980

I've prepared a new build which I'm hoping will have this fixed once and for all (it includes an update of the MSAL client lib and also ensures that the msalruntime dll is part of the package):

  • Installer: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.Installer.msi
  • Portable: https://cdn.tabulareditor.com/files/TabularEditor.2.27.1.zip

@pfab0, @TomekZag, could you try the above version and let me know? Thanks!

Hi @otykier, just to confirm - it also works now from CLI in Release Pipeline. Thank you for the fix!

TomekZag avatar Sep 26 '25 09:09 TomekZag