Bug 377347 - org.eclipse.egit.ui replaces the default eclipse authenticator thus messing up ordinary HTTP requests
Summary: org.eclipse.egit.ui replaces the default eclipse authenticator thus messing u...
Status: CLOSED DUPLICATE of bug 368882
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-22 07:41 EDT by Danail Branekov CLA
Modified: 2014-06-11 16:37 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danail Branekov CLA 2012-04-22 07:41:16 EDT
Here is a description of my network configuration:
 - In order to connect to the internet from my network I have to use HTTP proxy which is properly configured in the network connections preferences
 - I use a Git server which is located in my network and therefore I have added the Git server host to the proxy bypass list

I have been often (but not always) getting "HTTP 401 Unauthorized responses" from servers I am requesting via other eclipse tools. I believe that the reason for this is that the egit.ui plugin replaces the default authenticator with its own - org.eclipse.egit.ui.EclipseAuthenticator. 
Looking its implementation (method getPasswordAuthentication) I can see that it would only handle cases when the very HTTP proxy requires user credentiuals but NOT the cases when remote systems on the internet require basic authentication.

The reason to not get the HTTP 401 errors every time is the unspecified eclipse bundle start order. The bundle org.eclipse.ui.net also provides authenticator (org.eclipse.ui.internal.net.auth.NetAuthenticator) which can handle both authentication to HTTP proxy and systems outside the private network. My HTTP 401 errors appear in the cases when org.eclipse.egit.ui starts AFTER org.eclipse.ui.net which replaces the authenticator  org.eclipse.ui.internal.net.auth.NetAuthenticator with org.eclipse.egit.ui.EclipseAuthenticator

In order to confirm the statement above I have simply disabled EGit from my runtime workbench and all HTTP 401 errors were gone.

So I guess that EGit tools should stick to the standard Eclipse authenticator defined in org.eclipse.net.ui rather then a custom one.

BTW, this issue might have connection to Bug 311640

Regards, Danail
Comment 1 Ted Jones CLA 2012-07-01 10:49:43 EDT
FYI - I have experienced the same issue with EGit installed in JBDS.
Comment 2 Nick Boldt CLA 2012-07-05 15:47:08 EDT
Just to clarify which in version of egit this behaviour is seen, I believe Ted is referring to JBDS 5.0.0.GA, which comes with org.eclipse.egit_1.3.0.201202151440-r preinstalled.
Comment 3 Danail Branekov CLA 2012-07-13 11:17:21 EDT
Hi Nick,

The org.eclipse.egit.ui version on my side is 1.3.0.201202151440-r

Regards, Danail
Comment 4 Daniel Johnson CLA 2014-06-11 16:37:30 EDT

*** This bug has been marked as a duplicate of bug 368882 ***