Bug 45832 - add DIGEST authentication support to Ant tasks
Summary: add DIGEST authentication support to Ant tasks
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.18
Hardware: All All
: P2 enhancement (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-18 05:17 UTC by Marcus Better
Modified: 2017-05-30 11:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Better 2008-09-18 05:17:41 UTC
It would be useful if the Catalina Ant tasks supported HTTP Digest authentication, in addition to Basic authentication. This is convenient if one already has a digest-based security realm and doesn't want to maintain an extra  tomcat-users.xml file. (And Basic authentication is terribly insecure.)

Currently the AbstractCatalinaTask [1] just performs Basic authentication:

  // Set up an authorization header with our credentials
  String input = username + ":" + password;
  String output = new String(Base64.encode(input.getBytes()));
  hconn.setRequestProperty("Authorization",
                           "Basic " + output);

[1] http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java
Comment 1 Mark Thomas 2008-09-18 06:06:37 UTC
Patches are always welcome.
Comment 2 Marcus Better 2008-09-18 06:35:33 UTC
(In reply to comment #1)
> Patches are always welcome.

Is it ok to use something like commons-httpclient that does Digest auth?
Comment 3 Mark Thomas 2008-09-18 06:46:57 UTC
Personally, I'd rather not add a dependency just for that.
Comment 4 Mark Thomas 2017-05-30 11:48:53 UTC
There turned out to be a very simple solution that didn't require an external library using java.net.Authenticator.

Fixed in:
- trunk for 9.0.0.M22 onwards
- 8.5.x for 8.5.16 onwards
- 8.0.x for 8.0.45 onwards
- 7.0.x for 7.0.78 onwards