azure-devops-intellij: Get AuthenticationInfo failed exception

Rider IDE info:

JetBrains Rider 2018.2 EAP
Build #RD-182.3894.140, built on July 26, 2018
Rider EAP User
Expiration date: August 25, 2018
JRE: 1.8.0_152-release-1226-b7 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Plugin Info:

Version: 1.125.0

Exception:

getAuthenticationInfoAsync failed

com.microsoft.alm.plugin.exceptions.TeamServicesException: KEY_VSO_AUTH_FAILED
	at com.microsoft.alm.plugin.authentication.facades.VsoAuthInfoProvider.getAuthenticationInfoAsync(VsoAuthInfoProvider.java:98)
	at com.microsoft.alm.plugin.authentication.VsoAuthenticationProvider.authenticateAsync(VsoAuthenticationProvider.java:69)
	at com.microsoft.alm.plugin.authentication.AuthHelper.getAuthenticationInfoSynchronously(AuthHelper.java:59)
	at com.microsoft.alm.plugin.context.ServerContextManager.getAuthenticationInfo(ServerContextManager.java:489)
	at com.microsoft.alm.plugin.context.ServerContextManager.createContextFromGitRemoteUrl(ServerContextManager.java:372)
	at com.microsoft.alm.plugin.context.ServerContextManager.createContextFromGitRemoteUrl(ServerContextManager.java:353)
	at com.microsoft.alm.plugin.context.ServerContextManager.getAuthenticatedContext(ServerContextManager.java:333)
	at com.microsoft.alm.plugin.context.ServerContextManager.getUpdatedContext(ServerContextManager.java:563)
	at com.microsoft.alm.plugin.operations.Operation$1.run(Operation.java:184)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Explain

When I’ve tried to login in my TFS account I enter the correct information ( email && password ). also i receive “token added mail”.

applicationframehost_2018-07-29_10-06-03

Logs

idea.log

backend.zip

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 56 (1 by maintainers)

Most upvoted comments

Steps to reproduce

It looks like I was able to achieve a stable reproduction of issue in my environment. Here’s the steps to reproduce the issue:

  1. Create a Git repository in your Azure DevOps account.
  2. Create a local project in your IDE of choice (e.g. IDEA).
  3. Select menu item VCS | Import into Version Control | Import into Azure DevOps Services Git….
  4. Sign in into Azure DevOps account.
  5. Select any existing project, enter a repository name, press Import.

Now, depending on IDEA version and your Git settings, you’ll encounter one of the following scenarios:

  1. IDEA <= 2018.2, git with default credential manager (Windows): you’ll be asked for credentials again, everything will work afterwards. But if you cancel the first credential manager request, then see next item.
  2. IDEA <= 2018.2, git without credential manager: you’ll be asked for credentials again, and again, and again; nothing will work.
  3. IDEA 2019.1+: the same as 2, but git credential manager doesn’t matter; it won’t work anyway.

Bad news

As you can see, the issue is becoming more serious in more recent versions of IDEA and other IDEA-based IDEs.

The troublesome component is TfGitHttpAuthDataProvider. This component becomes active if Git asks IDEA for credentials. In IDEA 2017 and 2018, it was a rare case on Windows (only if the credential manager was manually disabled or if the user explicitly canceled the credential manager request), but it now works by default in IDEA 2019.1+, because IDEA now disables the default credential manager when the Git is started from IDEA.

In IDEA 2017, it had one problem: the format of URL it received was not the expected one. Git was sending the following URL: https://username@dev.azure.com, but the plugin expected the format https://dev.azure.com/username. The URL was successfully patched inside of an authentication flow (and that’s why the authentication seems to work), but it wasn’t patched afterwards. So, the plugin was asking the authentication mechanism to provide the credentials for URL https://username@dev.azure.com, but the mechanism only had the credentials for URL https://dev.azure.com/username.

It became even worse in IDEA 2018, because now the GitHttpAuthDataProvider interface is expanded to not pass the username by default (the plugin need to override another method to get the username).

And it became much worse around IDEA 2019, because now IDEA disables the default credential manager, so the plugin’s mechanism is suddenly always enabled.

Good news

The good news is that now we have a reproduction steps and we’re fully aware of the issue. Hopefully we’ll be able to fix it very soon. Thanks to everyone who reported here, and we’re sorry for the inconveniences caused by this issue. Please stay tuned.

Same issue here…

IntelliJ IDEA 2019.1 (Ultimate Edition) Build #IU-191.6183.87, built on March 27, 2019 JRE: 1.8.0_202-release-1483-b39 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.0.3-200.fc29.x86_64

plugin version: 1.150.0

Is there a planned date for the deployment of this patch?

@ForNeVeR

I am not sure what you are asking me to explain. But that strange URL is the Repository URL for the project saved in git. It is: https://username.visualstudio.com/DefaultCollection/Project Name/_git/Repository-Name

I’ve tested it repeatedly. When I get the list projects from DevOps, I see the new URL scheme. But after I save it to my IDE, the Repository URL value is saved in the git config file in the format above.

The URL online in DevOps is: https://dev.azure.com/username/project name

Maybe this is a problem with my account and I should check with DevOps support.

@ForNeVeR I have 1.152.0 and I am using both AppCode 2019.1.3 and Rider 2019.1.2. The issue I was facing with earlier versions of this plugin was that my origin remote was pointed to https://dev.azure.com/$accountname/$project/_git/$repositoryname and I would receive the feedback loop. Once I manually changed the remote URL to https://$accountname@dev.azure.com/$accountname/$project/_git/$repositoryname, it works fine.

However, I just checked in Rider by manually changing the remote URL back to https://dev.azure.com/$accountname/$project/_git/$repositoryname to test it for this issue and I am receiving the feedback loop again.

@ForNeVeR

Hi. I have the latest version of the Azure DevOps plugin installed for PyCharm and have been using it since yesterday. I want to report that it doesn’t fix anything for me. I was hoping it will resolve my problems since I discovered this thread two weeks ago.

I’ve been having the same symptoms with the plugin for a year. In my case, it is actually a couple of issues. I use Azure DevOps git repo.

  1. I experience the looping authentication prompt problem if I switch my Azure DevOps account URL to https://dev.azure.com/accountname. If I set it to the old URL format of https://accountname.visualstudio.com, the looping stops and authentication succeeds.

  2. After authentication succeeds, my Azure DevOps account credentials appears to be saved and listed in PyCharm under Settings, Version Control, Azure DevOps Services/TFS. However the behavior of having my account info saved is not what I experienced prior to Azure DevOps changing the URL format. Since a few releases ago, I always have to authenticate once with the azure browser prompt and entering the authentication code when I access my repo in PyCharm. So it is always on first access call. I don’t have to do it again unless PyCharm is restarted. For each successful first time authentication, a PAT is added to my user account in DevOps.

I’ve been doing PAT house cleaning once in a while. This is not the end of the world but I am concerned that one day Azure DevOps will retire the old URL and I will have a serious issue.

The issue is not fixed in 1.151.2 still getting

getAuthenticationInfoAsync failed

com.microsoft.alm.plugin.exceptions.TeamServicesException: KEY_VSO_AUTH_FAILED at com.microsoft.alm.plugin.authentication.facades.VsoAuthInfoProvider.getAuthenticationInfoAsync(VsoAuthInfoProvider.java:100) at com.microsoft.alm.plugin.authentication.VsoAuthenticationProvider.authenticateAsync(VsoAuthenticationProvider.java:69) at com.microsoft.alm.plugin.authentication.AuthHelper.getAuthenticationInfoSynchronously(AuthHelper.java:59) at com.microsoft.alm.plugin.idea.git.extensions.TfGitHttpAuthDataProvider.getAuthData(TfGitHttpAuthDataProvider.java:39) at git4idea.remote.GitHttpAuthDataProvider.getAuthData(GitHttpAuthDataProvider.java:41)

İ have face with this loop (oauth2 asking email and pass again and again) after update ubuntu 18.04 to 18.10

Same issue here. The first git pull worked, now when I try to push, fetch or whatever, I’m asked to login to my Microsoft account. I insert email, password, confirm 2FA on my phone… and then it asks to login again in a loop.