Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 151077 - Add support for HTTP Digest authentication to Trac connector
Summary: Add support for HTTP Digest authentication to Trac connector
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: dev   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-19 09:27 EDT by Daniel Serodio CLA
Modified: 2006-07-28 14:32 EDT (History)
1 user (show)

See Also:


Attachments
mylar/context/zip (2.94 KB, application/octet-stream)
2006-07-20 22:39 EDT, Mik Kersten CLA
no flags Details
mylar/context/zip (37.00 KB, application/octet-stream)
2006-07-27 18:16 EDT, Steffen Pingel CLA
no flags Details
Replaces all uses of URLConnection by HttpClient (52.76 KB, patch)
2006-07-27 18:26 EDT, Steffen Pingel CLA
no flags Details | Diff
Remove call to System.out.println() (866 bytes, patch)
2006-07-27 19:45 EDT, Steffen Pingel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Serodio CLA 2006-07-19 09:27:46 EDT
Currently (0.6.0.v20060717-2300), the Trac connector supports only Basic HTTP authentication.
Please add support for HTTP Digest authentication.
Comment 1 Steffen Pingel CLA 2006-07-20 18:35:28 EDT
Currently HttpURLConnection is used to connect to the repository which does not support digest authentication. The implementation needs to be changed to use Apache HTTPClient instead.
Comment 2 Mik Kersten CLA 2006-07-20 22:39:04 EDT
Created attachment 46619 [details]
mylar/context/zip

To make mylar.tasks.core the place that encapsulates our http/url connections, I extracted our URLConnection code into mylar.internal.tasks.core.UrlConnectionUtil.  This will help ensure that we use consistent proxy and ssl connections.  You can add the HTTPClient code you need to that class.
Comment 3 Mik Kersten CLA 2006-07-20 22:40:25 EDT
Also note that we make considerably use of HttpClient elsewhere in the code (just search for that text), so we amy want to extract some of that to use the common UrlConnectionUtil.
Comment 4 Mik Kersten CLA 2006-07-27 12:01:45 EDT
Steffen, what's the eta of this?  It seems like it's blocking people given the comments on bug 140512.
Comment 5 Steffen Pingel CLA 2006-07-27 12:07:04 EDT
The implementation is done. I just need to setup a repository with digest authentication to test it. I'll submit a patch the migration to XML-RPC 3.0 has been merged (bug 151896).
Comment 6 Steffen Pingel CLA 2006-07-27 18:16:47 EDT
Created attachment 46914 [details]
mylar/context/zip
Comment 7 Steffen Pingel CLA 2006-07-27 18:26:13 EDT
Created attachment 46915 [details]
Replaces all uses of URLConnection by HttpClient

I have setup a repository that requires digest authentication at http://mylar.eclipse.org/trac010digest . Some of the Trac test cases now require a credentials.properties file identical to the one used by Bugzilla (this completes part of the work for bug 150456).
Comment 8 Steffen Pingel CLA 2006-07-27 18:50:29 EDT
Regarding the static initializer on UrlConnectionUtil for the logging initialization of HttpClient (bug 151896 comment #13): This should be called as early as possible otherwise an instance of HttpClient may already have been created and the system properties will be ignored. This is currently the case when running the Trac tests and causes some console output.
Comment 9 Mik Kersten CLA 2006-07-27 19:10:24 EDT
Patch applied.  I moved the commons initialization to UrlConnectionUtil.initCommonsLogginSettings(), which is now called from TasksUiPlugin.start(..).  We could also add a call to that to AllTracTests.suite() in order to avoid the console output, but when I tried that I still got some output values that printed "4" two times.
Comment 10 Steffen Pingel CLA 2006-07-27 19:45:10 EDT
Created attachment 46920 [details]
Remove call to System.out.println()

My bad. Forgot to remove a debug statement.
Comment 11 Mik Kersten CLA 2006-07-27 20:55:56 EDT
Patch applied.
Comment 12 Daniel Serodio CLA 2006-07-28 11:07:03 EDT
Should 0.6.0.v20060727-1630 be able to do digest authentication? It didn't work for me, it still tried to do "basic" authentication. Do I need to explicitly (sp?) configure it to use digest?
Comment 13 Steffen Pingel CLA 2006-07-28 11:35:09 EDT
(In reply to comment #12)
> Should 0.6.0.v20060727-1630 be able to do digest authentication? It didn't work
> for me, it still tried to do "basic" authentication. Do I need to explicitly
> (sp?) configure it to use digest?

Yes, it should do digest authentication. I think the library tries basic authentication first before attempting digest authentication. There is no special configuration option.

Are you using the "XML-RPC" or "Trac 0.9" mode to access the repository?
Comment 14 Mik Kersten CLA 2006-07-28 12:15:03 EDT
Josh: is the authentication working for you?
Comment 15 Daniel Serodio CLA 2006-07-28 13:26:26 EDT
Got it!

I had "http://server/trac/projectfoo/" as the repository URL. Changing it to "http://server/trac/projectfoo" (no trailing slash) did it.
Comment 16 Josh Moore CLA 2006-07-28 13:45:38 EDT
Mik, thanks for checking back but I was intending to say with my comment from bug #140512 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=140512#c12) that my browser is currently non-functional, not Mylar related rather AMD64, https, etc. etc. Other bugs to file, perhaps, but I won't be able to test the new build. Again, thanks, and as soon as I have my other issues worked out, I'll get back on the boat.
Comment 17 Mik Kersten CLA 2006-07-28 14:32:33 EDT
Daniel: The trailing slash problem is bug 150890 and will hopefully be fixed before the release since others are bound to encounter this problem.

Josh: we have some Linux-specific browser troubleshooting instructions at: http://wiki.eclipse.org/index.php/Mylar_FAQ#Installing_on_Linux  If you could add your problems there that would be great (e.g. indicate that Eclipse's browser won't work on AMD64 with any OS specific details, you could make a new section if not running Linux).  That would help others in the same boat as you.  Also note that https will be working on Linux in an upcoming release if it isn't already (bug 80033).