Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
1.0-beta-2
-
None
-
None
-
client: jdk1.5
server: iis 6, tomcat 5.5 and ssl
-
Patch
Description
To use webdav over https with IIS 6, I changed two files to use NTCredentials. It is compatible with basic authentication.
-------
WebDavWagon.java
-------
try
{
httpURL = urlToHttpURL( url );
/* - begin - before
if ( hasAuthentication )
{
String userName = authenticationInfo.getUserName();
String password = authenticationInfo.getPassword();
if ( userName != null && password != null )
{ //httpURL.setUserinfo( userName, password ); webdavResource.setCredentials( new NTCredentials(userName, password, "host.com", "host") ); }}
- end - before
*/
CorrectedWebdavResource.setDefaultAction( CorrectedWebdavResource.NOACTION );
webdavResource = new CorrectedWebdavResource( httpURL );
// begin - after
if ( hasAuthentication )
{
String userName = authenticationInfo.getUserName();
String password = authenticationInfo.getPassword();
if ( userName != null && password != null )
{ //httpURL.setUserinfo( userName, password ); webdavResource.setCredentials( new NTCredentials(userName, password, repository.getHost(), repository.getHost()) ); }}
// end - after
-----------
CorrectedWebdavResource.java
-----------
/**
- FOWARD NTCREDENTIALS FOR EACH TRANSACTION
- It is compatible with basic authentication.
* - @see org.apache.webdav.lib.WebdavResource#generateTransactionHeader(org.apache.commons.httpclient.HttpMethod)
*/
protected void generateTransactionHeader(HttpMethod method) {
WebdavState state = (WebdavState) client.getState();
String host = null;
String realm = null;
if ( hostCredentials instanceof NTCredentials)
state.setCredentials(realm, host, hostCredentials);
super.generateTransactionHeader(method);
}
*******
LIMITATIONS
*******
Uses host as realm.