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

Failed to create pull request #68

Closed Michael2109 closed 7 years ago

Michael2109 commented 7 years ago
Failed to Create Pull Request: Authenticating to the server for Git repository '$URL' was not successful. Provide valid credentials and try again.

When creating a pull request a window will appear (I'm assuming to type in the credentials) but it closes before displaying anything. After this an Authorization Exception is shown in the Event Log.

AuthorizationException: getAuthenticationInfoAsync failed: Failed to get authenticated jaxrs client.

We are using a proxy so this may be the cause of this issue.

yacaovsnc commented 7 years ago

Hi @Michael2109, does your proxy server require authentication?

What is your java version and OS? I want to figure out why the browser auto closes, sounds like it crashed.

If this is a proxy issue, you may take a look at #43, I believe the proxy setting will be propagated to the browser window (which is the one that auto-closed). If your proxy requires authentication, we may need to setup device flow for it to work.

Michael2109 commented 7 years ago

Using Java 1.8.0_111 and Windows 7.

The proxy requires authentication. I've added the proxy settings in "Appearance & Behavior -> System Settings -> HTTP Proxy" and checked the connection but the issue still occurs.

I was thinking that if the browser tried opening without using the proxy authentication it possibly could cause it to break down.

I did see #43 but was a bit unsure as to why it was closed seeming as this issue didn't appear solved from the comments.

Let me know if you need any more information.

yacaovsnc commented 7 years ago

The underlying browser window doesn't support authenticated proxy due to #18.

To fallback to device flow, you can add this -DuserAgentProvider=none to your idea.exe.vmoptions (or idea64.exe.vmoptions, I modified both) file: image

Restart IntelliJ you should be prompted with a dialog box instead of the browser: image

Please click on the "https://aka.ms/devicelogin" link, and copy/paste the code in there. After you login via browser, click on "Continue" and you should be logged in.

This will bypass the proxy issue on the browser.

Michael2109 commented 7 years ago

I've added the line to both the 32bit and 64bit versions and restarted twice now. The dialog box doesn't seem to appear and instead it opens with the original browser.

-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-DuserAgentProvider=none
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dawt.useSystemAAFontSettings=lcd
yacaovsnc commented 7 years ago

Hmmm, this is odd. How about if you create a custom VM Options file and add the setting there?

image

Please restart IntelliJ afterwards again.

Michael2109 commented 7 years ago

This option is grayed out as we use a version of IntelliJ that has been changed by the company we are working with sorry. Are there any other methods of getting around this?

yacaovsnc commented 7 years ago

Ah, unfortunately currently the behavior can only be altered by properties. If your intelliJ instance is shielded from altering properties, we can't launch this device flow.

I will have to discuss internally on how to proceed at this point. It appears we must find an alternative to expose this setting.

Michael2109 commented 7 years ago

Okay thanks for your help!

yacaovsnc commented 7 years ago

The latest 1.116.1 plugin should search for a setting file in addition to the vmoptions file. On Windows system, it searches for the file at: %LOCALAPPDATA%\Microsoft\VstsAuthLib4J\settings.properties

On my system: 2017-04-11 14:54:19,958 [ 87002] INFO - oft.alm.helpers.SettingsHelper - Searching for C:\Users\yacao\AppData\Local\Microsoft\VstsAuthLib4J\settings.properties

The content of this file is just: userAgentProvider=none

leantk commented 7 years ago

Closing since there has been no follow-up. Please reopen if the issue still persists.

Thanks, -Leah