| Article: |
Sliding into WebDAV | |
| Subject: | WebDav & NTLM | |
| Date: | 2005-07-10 07:52:10 | |
| From: | Yensen | |
|
Need Help!!! 1. Are there codes to handle NTLM connection? I am sending the request to IIS (Windows 2003 Server), when I run the codes, HttpURL hrl = new HttpURL(mySite); hrl.setUserinf(myUserName,myPassword); The response is WARNING: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials.
|
||
Showing messages 1 through 5 of 5.
-
WebDav & NTLM
2005-08-01 07:01:16 bwandrack [View]
-
WebDav & NTLM
2007-02-12 09:30:59 PabloMosquera [View]
Hi, Im facing the same problem. Im trying to connect to a IIS server and I use the NTCredentials code. I have these exceptions.
org.apache.commons.httpclient.HttpException
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3467)
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3423) -
WebDav & NTLM
2007-02-12 09:27:25 PabloMosquera [View]
Hi, Im having the same problem with the same httpException. I´m trying to connect to a IIS server and I use the same code. Please tell me how you solved the problem
I have these exceptions
org.apache.commons.httpclient.HttpException
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3467)
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3423)
...
Thanks -
WebDav & NTLM
2005-09-19 03:34:29 dennis_surendar [View]
Bill,
Tried with the code given above:
NTCredentials creds = new NTCredentials(userName, password, hostAdd, "" );
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(hostAdd); //Not url, just ip address or fully qualified DN
HttpURL host = new HttpURL("http://" + hostUrl);
WebdavResource res = new WebdavResource(host, (Credentials)creds, WebdavResource.DEFAULT, DepthSupport.DEPTH_1);
However, I see an authentication-warning message saying "Already tried to authenticate with null authentication realm at <exchange server name>, but still receiving: HTTP/1.1 401 Access Denied". Proceeding furhter with the method "WebdavResource.list ();" gives a NullPointerException.
Am I doing something wrong? Do I need to setup my Tomcat to redirect the authentication to MS Exchange server? Please help.
Thanks in advance.
- Dennis. -
WebDav & NTLM
2005-09-20 04:27:52 dennis_surendar [View]
Bill,
Finally I solved the puzzle.
Before trying with the above code snippet, I tried to access my Exchange server through Outlook Web Access (OWA) from my browser. While doing so, the browser saved the prompted user-id (Administrator) and password in the password manager.
Hence, for the next time, when I tried to connect to the Exchange server using your code snippet, I got the following error message -
"Already tried to authenticate with null authentication realm at ${Exchange server name}, but still receiving: HTTP/1.1 401 Access Denied".
To overcome this, I just cleared the saved passwords in the browser settings. After doing so, the program works like a charm...!
Thank you.
Regards,
Dennis.



Can't help with #2, but I am currently using NTLM and WebDav. Here is some sample code that should help:
NTCredentials creds = new NTCredentials(userName, password, hostAdd, "" );
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(hostAdd); //Not url, just ip address or fully qualified DN
HttpURL host = new HttpURL("http://" + hostUrl);
WebdavResource res = new WebdavResource(host, (Credentials)creds, WebdavResource.DEFAULT, DepthSupport.DEPTH_1);
Hope this helps.
Bill Wandrack