microsoft / azure-devops-intellij

IntelliJ IDEA plug-in for Visual Studio Team Services and Team Foundation Server (TFS)
MIT License
151 stars 95 forks source link

Get AuthenticationInfo failed exception #158

Closed xsoheilalizadeh closed 5 years ago

xsoheilalizadeh commented 6 years ago

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

whoisj commented 6 years ago

I get a similar issue if TF.exe is unable to complete its checkout operation. Did you correctly set the parent and workspace directory when you attempted to create the workspace?

24mu13 commented 5 years ago

Still the same on 1.150.0

fmonts commented 5 years ago

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.

timedata commented 5 years ago

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

sideez commented 5 years ago

Having the same issue here. Keep getting prompted to sign in.

joshuataylor commented 5 years ago

Same issue here on Ubuntu 18.10, using 2FA.

I: 1/ Open Rider 2/ Click "Checkout with VSTS" 3/ A login box comes up, type in email, password, and then confirm 2FA 4/ A list of all my repos comes up, so I choose the repository, and click clone. 5/ It asks me to sign in again, closes the window, thinks for a second, then reopens the window and loops.

HaGGi13 commented 5 years ago

I have exactly the same issue-

System info:

  • IntelliJ 2018.2.5
  • Ubuntu 18.10
  • Visual Studio Team Services Plugin 1.150.0
  • JDK 1.8.0 (x64)
  1. open IntelliJ
  2. Click "Team Services Git"
  3. A login box comes up, click sign in, type in email, password and then confirm 2FA with Token on VSTS web site
  4. A list of all my repos comes up, so I choose the repository, and click clone.
  5. IntelliJ tries to clone the repo
  6. after some seconds 2FA pop up is displayed like in 3. with another token
  7. does 2FA like in 3. and ends up with endless loop with 2FA

Here are some anonymized log messages:

2018-11-04 14:59:58,213 [  30382]   WARN - n.settings.TeamServicesSecrets - getServerContextSecrets: info was null for key:  
2018-11-04 14:59:58,213 [  30382]   INFO - .checkout.VsoCheckoutPageModel - Skipping loading contexts in constructor 
2018-11-04 15:00:00,459 [  32628]   INFO - .checkout.VsoCheckoutPageModel - loadRepositories called 
2018-11-04 15:00:00,460 [  32629]   INFO - tion.VsoAuthenticationProvider - authenticateAsync for server: https://app.vssps.visualstudio.com 
2018-11-04 15:00:00,701 [  32870]   INFO - .auth.pat.VstsPatAuthenticator - Signing out from uri: https://app.vssps.visualstudio.com 
2018-11-04 15:00:00,731 [  32900]   INFO - auth.oauth.OAuth2Authenticator - Ready to launch browser flow to retrieve oauth2 token. 
2018-11-04 15:00:00,734 [  32903]   INFO - oft.alm.helpers.SettingsHelper - Searching for /home/REPLACED_USERNAME/.microsoft/VstsAuthLib4J/settings.properties 
2018-11-04 15:00:00,734 [  32903]   INFO - auth.oauth.OAuth2Authenticator - Attempt to use oauth2-useragent provider: none 
2018-11-04 15:00:00,734 [  32903]   INFO - auth.oauth.OAuth2Authenticator - Fallback to Device Flow. 
2018-11-04 15:00:39,879 [  72048]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:00:41,651 [  73820]   INFO - tion.VsoAuthenticationProvider - getAuthenticationInfoAsync succeeded 
2018-11-04 15:00:41,653 [  73822]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:00:42,877 [  75046]   INFO - on.ServerContextLookupListener - loadContexts activeOperation with 1 contexts and a scope of REPOSITORY 
2018-11-04 15:00:42,878 [  75047]   INFO - on.ServerContextLookupListener - loadContexts terminateActiveOperation in state NOT_STARTED 
2018-11-04 15:00:42,878 [  75047]   INFO - on.ServerContextLookupListener - ServerContext operation terminated 
2018-11-04 15:00:42,879 [  75048]   INFO - on.ServerContextLookupListener - ServerContext lookup started 
2018-11-04 15:00:42,885 [  75054]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:00:44,344 [  76513]   INFO - on.ServerContextLookupListener - ServerContext lookup results has error: false 
2018-11-04 15:00:44,345 [  76514]   INFO - on.ServerContextLookupListener - ServerContext lookup completed 
2018-11-04 15:00:44,358 [  76527]   INFO - on.ServerContextLookupListener - ServerContext operation done 
2018-11-04 15:00:50,525 [  82694]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:00:51,576 [  83745]   INFO - .auth.pat.VstsPatAuthenticator - Retrieving PersonalAccessToken for uri:https://REPLACED_URL_PART.visualstudio.com with name:VSTS IntelliJ Plugin: ChristopherWolf.87@live.de from: vWolverine on: Sun Nov 04 15:00:51 CET 2018, and with scope:, prompt behavior: AUTO 
2018-11-04 15:00:53,146 [  85315]   INFO -  #git4idea.commands.GitHandler - [.] git version 
2018-11-04 15:00:53,156 [  85325]   INFO -  #git4idea.commands.GitHandler - git version 2.19.1 
2018-11-04 15:00:53,165 [  85334]   INFO - ea.config.GitExecutableManager - Git version for /usr/bin/git : 2.19.1 
2018-11-04 15:00:53,166 [  85335]   INFO -  #git4idea.commands.GitHandler - [/home/REPLACED_USERNAME/XYZ] git clone --progress https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME -- REPLACED_PROJECT_NAME 
2018-11-04 15:00:53,173 [  85342]   INFO -  #git4idea.commands.GitHandler - Cloning into 'REPLACED_PROJECT_NAME'... 
2018-11-04 15:00:54,165 [  86334]   INFO - n.context.ServerContextManager - AuthenticatedInfo found for url http://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:00:54,690 [  86859]   INFO -  #git4idea.commands.GitHandler - fatal: Authentication failed for 'https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME/' 
2018-11-04 15:00:54,698 [  86867]   INFO - n.context.ServerContextManager - Updating auth info for url https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:00:54,698 [  86867]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo compare /DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME 
2018-11-04 15:00:54,699 [  86868]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo removed 
2018-11-04 15:00:54,699 [  86868]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo prompting 
2018-11-04 15:00:54,699 [  86868]   INFO - .auth.pat.VstsPatAuthenticator - Signing out from uri: https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:00:54,700 [  86869]   INFO - ugin.authentication.AuthHelper - getAuthenticationInfoSynchronously calling authenticateAsync on https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:00:54,701 [  86870]   INFO - tion.VsoAuthenticationProvider - authenticateAsync for server: https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:00:54,701 [  86870]   INFO - .auth.pat.VstsPatAuthenticator - Signing out from uri: https://app.vssps.visualstudio.com 
2018-11-04 15:00:54,701 [  86870]   INFO - auth.oauth.OAuth2Authenticator - Ready to launch browser flow to retrieve oauth2 token. 
2018-11-04 15:00:54,703 [  86872]   INFO - auth.oauth.OAuth2Authenticator - Attempt to use oauth2-useragent provider: none 
2018-11-04 15:00:54,703 [  86872]   INFO - auth.oauth.OAuth2Authenticator - Fallback to Device Flow. 
2018-11-04 15:01:23,031 [ 115200]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:01:24,109 [ 116278]   INFO - .auth.pat.VstsPatAuthenticator - Retrieving PersonalAccessToken for uri:https://REPLACED_URL_PART.visualstudio.com with name:VSTS IntelliJ Plugin: ChristopherWolf.87@live.de from: vWolverine on: Sun Nov 04 15:01:24 CET 2018, and with scope:, prompt behavior: AUTO 
2018-11-04 15:01:25,323 [ 117492]   INFO - tion.VsoAuthenticationProvider - getAuthenticationInfoAsync succeeded 
2018-11-04 15:01:25,323 [ 117492]   INFO - .services.HttpProxyServiceImpl - useHttpProxy: false 
2018-11-04 15:01:25,673 [ 117842]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo not null 
2018-11-04 15:01:25,673 [ 117842]   INFO - n.context.ServerContextManager - https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME       https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:01:25,673 [ 117842]   INFO - n.context.ServerContextManager - The updated auth info created a context that has a different remote url 
2018-11-04 15:01:25,673 [ 117842]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo compare  
2018-11-04 15:01:25,674 [ 117843]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo returning an updated context: false 
2018-11-04 15:01:25,674 [ 117843]   INFO -  #git4idea.commands.GitHandler - git clone took 32508 ms. Command parameters: 
/usr/bin/git clone --progress https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME -- REPLACED_PROJECT_NAME 
2018-11-04 15:01:25,675 [ 117844]   INFO -  #git4idea.commands.GitHandler - [/home/REPLACED_USERNAME/XYZ] git -c core.quotepath=false -c log.showSignature=false clone --progress --recurse-submodules https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME -- REPLACED_PROJECT_NAME 
2018-11-04 15:01:25,680 [ 117849]   INFO -  #git4idea.commands.GitHandler - Cloning into 'REPLACED_PROJECT_NAME'... 
2018-11-04 15:01:26,723 [ 118892]   INFO -  #git4idea.commands.GitHandler - fatal: Authentication failed for 'https://REPLACED_URL_PART.visualstudio.com/DefaultCollection/XYZ/_git/REPLACED_PROJECT_NAME/' 
2018-11-04 15:01:26,728 [ 118897]   INFO - n.context.ServerContextManager - Updating auth info for url https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:01:26,729 [ 118898]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo compare  
2018-11-04 15:01:26,729 [ 118898]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo removed 
2018-11-04 15:01:26,729 [ 118898]   INFO - n.context.ServerContextManager - auth info updateAuthenticationInfo prompting 
2018-11-04 15:01:26,730 [ 118899]   INFO - .auth.pat.VstsPatAuthenticator - Signing out from uri: https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:01:26,730 [ 118899]   INFO - ugin.authentication.AuthHelper - getAuthenticationInfoSynchronously calling authenticateAsync on https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:01:26,730 [ 118899]   INFO - tion.VsoAuthenticationProvider - authenticateAsync for server: https://REPLACED_URL_PART.visualstudio.com 
2018-11-04 15:01:26,730 [ 118899]   INFO - .auth.pat.VstsPatAuthenticator - Signing out from uri: https://app.vssps.visualstudio.com 
2018-11-04 15:01:26,730 [ 118899]   INFO - auth.oauth.OAuth2Authenticator - Ready to launch browser flow to retrieve oauth2 token. 
2018-11-04 15:01:26,730 [ 118899]   INFO - auth.oauth.OAuth2Authenticator - Attempt to use oauth2-useragent provider: none 
2018-11-04 15:01:26,730 [ 118899]   INFO - auth.oauth.OAuth2Authenticator - Fallback to Device Flow.

If I try to clone manually via SSH everything works fine.

fmonts commented 5 years ago

Tried also with device flow authentication (in File -> Settings -> Version Control -> Team Services / TFS ) but the same loop occurs

HaGGi13 commented 5 years ago

Tried also with device flow authentication (in File -> Settings -> Version Control -> Team Services / TFS ) but the same loop occurs

Yes, I tried it too without success. Furthermore I've tried to use IntelliJ 2017.03, but it results in exactly the same behavior like described above.

breadbreadbread commented 5 years ago

Any solution?

fmonts commented 5 years ago

Any solution?

disable the plugin and do git pulls/pushes the classic way

Edit: if you re-enable the plugin after a while it works

itlackey commented 5 years ago

+1 same issue

Otgontugs commented 5 years ago

the same here

jonahbohlmann commented 5 years ago

the same here

sweethuman commented 5 years ago

the same here

maartenba commented 5 years ago

Seeing the same

Welshmon commented 5 years ago

Also getting the endless auth loop

MrAdam commented 5 years ago

Same issue here..

AmitBhatnagar24 commented 5 years ago

Same.. just started recently for my team.

sweethuman commented 5 years ago

Has anybody tried completely reinstalling rider? Does that help? It works for a while until it stops, what's the actual cause?

drewglew commented 5 years ago

Also same issue here. Didn't think it would be this hard to setup a Repo in Azure and plug it into my IDE of choice.

xsoheilalizadeh commented 5 years ago

Please attach the log if it happened again.

Help -> Compress Logs and Show in Explorer.

AmitBhatnagar24 commented 5 years ago

@devSoheilAlizadeh as requested.

logs-20190308-103837.zip

ForNeVeR commented 5 years ago

What's interesting here is that every "KEY_VSO_AUTH_FAILED" gets preceded by the following:

"The browser window was closed by the user" (stack trace) ``` com.microsoft.alm.oauth2.useragent.AuthorizationException: Code: cancelled Description: The browser window was closed by the user. at com.microsoft.alm.oauth2.useragent.AuthorizationResponse.fromString(AuthorizationResponse.java:109) at com.microsoft.alm.oauth2.useragent.UserAgentImpl.encode(UserAgentImpl.java:195) at com.microsoft.alm.oauth2.useragent.UserAgentImpl.requestAuthorizationCode(UserAgentImpl.java:152) at com.microsoft.alm.auth.oauth.AzureAuthority.acquireAuthorizationCode(AzureAuthority.java:318) at com.microsoft.alm.auth.oauth.AzureAuthority.acquireToken(AzureAuthority.java:236) at com.microsoft.alm.auth.oauth.OAuth2Authenticator$1.doRetrieve(OAuth2Authenticator.java:245) at com.microsoft.alm.auth.oauth.OAuth2Authenticator$1.doRetrieve(OAuth2Authenticator.java:168) at com.microsoft.alm.auth.BaseAuthenticator$SecretRetriever.retrieve(BaseAuthenticator.java:268) at com.microsoft.alm.auth.oauth.OAuth2Authenticator.getOAuth2TokenPair(OAuth2Authenticator.java:284) at com.microsoft.alm.plugin.authentication.facades.VsoAuthInfoProvider.getAuthenticationInfoAsync(VsoAuthInfoProvider.java:90) at com.microsoft.alm.plugin.authentication.VsoAuthenticationProvider.authenticateAsync(VsoAuthenticationProvider.java:69) at com.microsoft.alm.plugin.idea.common.ui.common.LookupHelper.authenticateAndLoadVsoContexts(LookupHelper.java:158) at com.microsoft.alm.plugin.idea.common.ui.checkout.VsoCheckoutPageModel.loadRepositories(VsoCheckoutPageModel.java:79) at com.microsoft.alm.plugin.idea.common.ui.checkout.CheckoutPageController.actionPerformed(CheckoutPageController.java:92) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink.notifyActionListeners(Hyperlink.java:91) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink.access$000(Hyperlink.java:25) at com.microsoft.alm.plugin.idea.common.ui.controls.Hyperlink$1.linkSelected(Hyperlink.java:35) at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:142) at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:356) at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:330) at java.awt.Component.processMouseEvent(Component.java:6548) at javax.swing.JComponent.processMouseEvent(JComponent.java:3325) at java.awt.Component.processEvent(Component.java:6313) at java.awt.Container.processEvent(Container.java:2237) at java.awt.Component.dispatchEventImpl(Component.java:4903) at java.awt.Container.dispatchEventImpl(Container.java:2295) at java.awt.Component.dispatchEvent(Component.java:4725) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467) at java.awt.Container.dispatchEventImpl(Container.java:2281) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4725) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:737) at java.awt.EventQueue$4.run(EventQueue.java:735) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) at java.security.AccessController.doPrivileged(Native Method) at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233) at java.awt.Dialog.show(Dialog.java:1077) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:698) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430) at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1681) at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1630) at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1645) at com.microsoft.alm.plugin.idea.common.ui.common.BaseDialogImpl.showModalDialog(BaseDialogImpl.java:185) at com.microsoft.alm.plugin.idea.common.ui.checkout.CheckoutController.showModalDialog(CheckoutController.java:75) at com.microsoft.alm.plugin.idea.git.extensions.GitCheckoutProvider.doCheckout(GitCheckoutProvider.java:39) at com.intellij.openapi.vcs.checkout.CheckoutAction.actionPerformed(CheckoutAction.java:29) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:275) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:287) at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:283) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:106) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:277) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:111) at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88) at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111) at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120) at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111) at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:522) at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:35) at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:544) at java.awt.Component.processMouseEvent(Component.java:6548) at javax.swing.JComponent.processMouseEvent(JComponent.java:3325) at java.awt.Component.processEvent(Component.java:6313) at java.awt.Container.processEvent(Container.java:2237) at java.awt.Component.dispatchEventImpl(Component.java:4903) at java.awt.Container.dispatchEventImpl(Container.java:2295) at java.awt.Component.dispatchEvent(Component.java:4725) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467) at java.awt.Container.dispatchEventImpl(Container.java:2281) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4725) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:737) at java.awt.EventQueue$4.run(EventQueue.java:735) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) ```
erielmiquilino commented 5 years ago

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

ForNeVeR commented 5 years ago

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.

Kimmova commented 5 years ago

Looking forward to the new release where this is fixed.

In the meantime I have found a fix until this plugin is fixed - tested on the newest IntelliJ IDEA 2019.1.2 at the time of writing.

NOTE: THIS FIX DOES NOT WORK WITH THIS PLUGIN BUT ONLY WITH THE DEFAULT GIT PLUGIN

This fix should remember the credentials properly until your personal access token expires (which you will have to create as part of this process).

For machines already logged in to repository tenant AD:

  1. Close all open projects so that you are presented with the IDEA startup page
  2. Close IDEA
  3. Open IDEA again
  4. Choose "Check out from Version Control" and select Git
  5. Paste URL from Azure Devops repository from the Clone button in the upper right corner (example: https://organization_name>@dev.azure.com/<organization_name//_git/)
  6. Press test which should be successful if you have access (only works first time)
  7. Try and press test once more to confirm that this now fails
  8. Navigate to your personal Access Tokens for azure devops at https://dev.azure.com//_usersSettings/tokens
  9. Select the newest entry named something like "Git: https://dev.azure.com/..." (make sure to select the token with the computer name corresponding to your current device if you're logging in from multiple devices)
  10. Press Regenerate and copy the generated token
  11. Paste the generated token into the login dialog in IntelliJ IDEA
  12. If the test now succeeds, press clone
  13. After cloning is complete, verify that you still have proper access by opening the project and navigating to VCS -> Git -> Pull and press pull

For machines not logged in to repository tenant AD:

  1. Close all open projects so that you are presented with the IDEA startup page
  2. Choose "Check out from Version Control" and select Git
  3. Paste URL from Azure Devops repository from the Clone button in the upper right corner (example: https://organization_name>@dev.azure.com/<organization_name//_git/)
  4. Press test which should prompt for password for user
  5. Navigate to your personal Access Tokens for azure devops at https://dev.azure.com//_usersSettings/tokens
  6. Create new personal access token and select a date in the future for when the token will expire (max is 1 year)
  7. Set the following permissions: "Read and write" under Code and "Read" under Packaging (press "Show all scopes" to see this)
  8. Press Create and copy the generated token
  9. Paste the generated token into the login dialog in IntelliJ IDEA
  10. If the test now succeeds, press clone
  11. After cloning is complete, verify that you still have proper access by opening the project and navigating to VCS -> Git -> Pull and press pull
TheYoxy commented 5 years ago

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

alonzosims commented 5 years ago

Having the same issue here. Keep getting prompted to sign in.

roy-shantanu commented 5 years ago

Waiting for the fix for a while :(

fmonts commented 5 years ago

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)

MichelWorld commented 5 years ago

Installing the available update resolved the issue for me.

ForNeVeR commented 5 years ago

Hello, everyone. Sorry for the pause in our release schedule. The new version has been published to the plugin update channel. You should be able to update the plugin in IDE.

Damen-Chan commented 5 years ago

@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.

rdadkins commented 5 years ago

@tingkchan

I had similar issues you were facing in point 1. I found that I had an incorrect remote setup. The format should be https://$accountname@dev.azure.com/$accountname/$project/_git/$repositoryname.

This URL can be found via the clone option in your selected repository.

I believe at one point the URL was https://dev.azure.com/$accountname/$project/_git/$repositoryname when they first introduced the new URL naming scheme.

Damen-Chan commented 5 years ago

@rdadkins

Thanks for the info. But I am seeing different URLs.

If the DevOps organization URL option is set to use https://dev.azure.com/accountname (since Visual Studio Online rebrand), I will run into the looping problem. If I set the URL option to off, it uses the old URL https://accountname.visualstudio.com. My Repository URL is currently stored in PyCharm as: https://accountname.visualstudio.com/DefaultCollection/Project Name/_git/Repo Name

The repo URL is saved automatically. I don't see a way to edit it. This is the only way I've been able to use the plugin, abide dealing with the little annoyance of my issue #2.

I just saw a new release of the plugin in PyCharm. Going to test it now.

ForNeVeR commented 5 years ago

@tingkchan

  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.

Сould you please provide more detailed steps for me to reproduce? E.g. which kind of repository I should create (I suppose that's Git and not TFVC, right?), and how exactly are you cloning/creating the repository?

  1. 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.

It could be an issue of Git interop withing the plugin: sometimes Git uses its own credential helper instead of one provided by IDEA, and it stores the credentials in other way. I sometimes hit this issue, too, but detailed steps to reproduce would help a lot. Screenshots of the auth windows you get would help, too (because Git credential helper and IDEA auth windows looks a bit different, so the screenshots would help in diagnosis).

Please note that this issue was only about getting the exact message that starts the thread: namely, getAuthenticationInfoAsync failed. If you have some other situation (and it seems that you do), then, please, create a new issue, and I'll be glad to help with the diagnostics, and maybe finally suggesting a fix for the issues you encounter.

Please also report more details about your issues:

If we'll be unable to reproduce the issue, we could also ask you to provide your IDE logs privately (please never post IDE logs in public because they could sometimes contain sensitive data).

ForNeVeR commented 5 years ago

@rdadkins, while you're very right that these details were extremely important earlier, currently the plugin is designed in a way agnostic to these URL changes: in simple words, it just strips the username@ part automatically as part of the URL normalization (because otherwise authentication weren't working in some cases), so it shouldn't matter in 1.152.0 released yesterday.

If you think that the URL difference is still important in some cases, then I'd like to discuss these cases in more details, because they should not be matter in 1.152.0.

rdadkins commented 5 years ago

@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.

Damen-Chan commented 5 years ago

@ForNeVeR

I am now running the latest version of the plugin. I also figured out that the issue maybe has something to do with the authentication method of "Username and password". With this method the repository URL is saved as https://accountname.visualstudio.com/DefaultCollection/Project Name/_git/Repo Name. Authentication looping will occur if I set the DevOps portal URL to use https://dev.azure.com/accountname. With authentication method set to "Device flow" however, the looping goes away. The repository URL using "Device flow" is saved as https://$accountname@dev.azure.com/$accountname/$project/_git/$repositoryname.

This is what I am talking about in regards to authentication prompts. I am always prompted on first repo access even when it is working. Let me know if it is normal behavior. But it was not this way a year ago.

  1. Enter random code, 2. Enter username and password and 3. Click 'Continue' on code prompt. This happens everytime when I need to access my repo.

Second step authentication code prompt

Third step authention enter code in browser

Please also report more details about your issues: exact version of JetBrains IDE you're using, PyCharm 2019.1.3 (Professional Edition) Build #PY-191.7479.30, built on May 29, 2019 Licensed to xxxxxxxx Subscription is active until May 6, 2020 JRE: 11.0.2+9-b159.60 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.0.0-16-generic

The issues are identical across my three computers. They are Linux machines running Kubuntu 19.04, Lubuntu 19.04 and OpenSuse Leap 15.

exact version of Azure DevOps plugin installed, 1.152.0

exact steps to reproduce the issue (if possible) To cause looping:

  1. Set DevOps Portal URL to use https://dev.azure.com/accountname
  2. Use "Username and password" as authentication method for the plugin

screenshots of every important step, including screen shots of every auth window you encounter (with your personal data removed, of course) Images are above.

ForNeVeR commented 5 years ago

@tingkchan we're definitely onto something, but I still was unable to reproduce the issue.

When I clone the repository using the plugin (in the main menu: VCS | Checkout from Version Control | Azure DevOps Git), the resulting Git remote has address starting from $username@dev.azure.com. I am unable to get URL without $username@, could you please elaborate on that? How are you cloning the repository?

I have also troubles following your step 1, "Set DevOps Portal URL to use https://dev.azure.com/accountname": how do I perform that?

I am already using the "Username and password" authentication method (because it causes most of the troubles and thus demands more testing).

Damen-Chan commented 5 years ago

@ForNeVeR

Step 1 refers to setting the organization URL. It's the first item if you go into Organization Settings. This setting was introduced when Visual Studio Online was rebranded to Azure DevOps. I noticed this problem a while back. I simply brushed it aside and kept my setting on using the old VSO URL which is https://accountname.visualstudio.com. I was hoping that it will fix itself when new updates are released. I don't know if you will have this option if your account was set up after the rebranding. I had my account back when it was VSO.

In the beginning (around the summer or fall 2018), I could not authenticate at all to Azure DeVops using the plugin if I change the setting to use https://dev.azure.com/accountname. I was not able to get a list of projects to clone from PyCharm's startup project screen. I could not access my account, period. I stuck with the old URL setting because I have no choice.

On each plugin update I would give it try with the new URL setting. Finally I was able to authenticate with the new URL setting ON. But it would do the authentication looping when I click "Clone". So the symptoms are that I can authenticate to get a list of my projects in DevOps, but then it prompts me to reauthenticate when I click "Clone". This reauthentication would keep reprompting until I close the authentication window popup with the random code. Doing this will cause an exception screen. Sorry I never get around to report this other issue. But it can be reproduced.

Another scenario is that if I change the DevOps organization URL to the new URL, existing projects that were already stored in PyCharm will result in authentication looping when authentication is needed, ie pulls and pushes.

Version 1.152.0 is progress and better than the previous versions since I am now able to use "Device flow" as a workaround. One thing I noticed though is that with "Device flow", after authentication the account info is temperarily saved until I close PyCharm. By that I mean if I look at the plugin settings I will see my account and repo URL info like the one I show you in my last post. They become empty if I close PyCharm. Should the info be saved permanently or is this how "Device flow" work. But I guess this is why I need to authenticate once everytime I use PyCharm, since it doesn't have any info stored.

Here is the image of the setting:

devops org setting url

ForNeVeR commented 5 years ago

@tingkchan thanks, got it. FYI, the "new" accounts have an option to switch to "old" URL, too. Also, now I think I understand your problem with the plugin not saving credentials between sessions, I'll extract the essential information into a new issue.

Could you please clarify how are you cloning the repository? Here you say

But it would do the authentication looping when I click "Clone".

Where are you clicking that? I've found this "Clone" button in the Azure DevOps web interface: image

When I clone over HTTPS, it adds the username to the URL, and when I choose to clone over SSH, it doesn't. Is it the clone function you refer to? Do you use SSH?

Damen-Chan commented 5 years ago

@ForNeVeR

I do it from my desktop in PyCharm.

Step 1. Startup Screen. I pick the DevOps Git option and I will get the authentication code pop up. Perform authentication and move step 2.

Screen1

Step 2. After I authenticated in Step 1. I get this popup with a list of projects in my DevOps account. Select project and then click the "Clone" buttton and I will get prompted for authentication again. After authentication passes I will get prompted again. And on and on.

screen2

ForNeVeR commented 5 years ago

Okay, could you please also check the resulting remote URL? git remote -v in terminal.

Damen-Chan commented 5 years ago

@ForNeVeR

Hello,

Urls from step1 authentication. X replaced actual values. Authenticated and got list of projects.

origin https://xxxxxx.visualstudio.com/DefaultCollection/X%20X%20X/_git/X-X-X (fetch) origin https://xxxxxx.visualstudio.com/DefaultCollection/X%20X%20X/_git/X-X-X (push)

Urls from step2 after selecting my project and clicking "Clone". git remote -v returns the URL below and I get prompted for authentication, random code, browser pops up again, enter code and then my user credentials.

origin https://xxxxxx.visualstudio.com/DefaultCollection/X%20X%20X/_git/X-X-X (fetch) origin https://xxxxxx.visualstudio.com/DefaultCollection/X%20X%20X/_git/X-X-X (push)

In PyCharm's settings though, I see:

https://ACCOUTNAME@dev.azure.com/ACCOUNTNAME/ . . .

PyCharm Seting

ForNeVeR commented 5 years ago

@tingkchan could you also please show result of this shell command?

git config --get credential.helper
ForNeVeR commented 5 years ago

@tingkchan for now, I was unable to reproduce your issue.

I've set my Azure DevOps organization to use "old" URL (https://username.visualstudio.com) and cloned several projects without any issues.

What is very strange is that your cloned repository URL contains visualstudio.com while all your screenshots only contain username@dev.azure.com and no traces of visualstudio.com. I've verified that the plugin works with that well though, so, for now, we have no explanations of why it doesn't work for you.

Damen-Chan commented 5 years ago

@ForNeVeR

Running "git config --get credential.helper" returns nothing.

Regarding the screenshots. Yes, it's weird. The ones above were captured as soon I cloned and opened the project. I want to update a statement I previously made. I thought it was after each PyCharm run but that's not the case. The git credentials will stay in PyCharm after first authentication for as long I remained logged onto my computer. If I restart my desktop sessions, the git credentials will be cleared.

Here is more screenshots for you. This is for when I reopen a project on my computer after I had shut down, log out or restared my computer. I have to authenticate if I need to access the repo. The settings were empty first. I checked over and over again.

Here is the screen after first time authentication:

authentication from within project

Here is the screen if I decide to do Update credential by clicking the button. I get prompted and authenticated. I get a second row in different format:

After doing Update credentials

If I close PyCharm and then launch it and reopen the project, only the credential from the first screenshot exist.

I am starting to go nuts on this. :-)

ForNeVeR commented 5 years ago

@tingkchan looks like your projects has a space in its name. Is that true?