473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Authentication with WebDav

Hey folks,

I'm trying to communicate with our Exchange server using WebDav to get the
User's personal contacts folder. Works fine if I hardcode their username
and password (obviously not an acceptable solution), but when I use
Integrated Authentication I get "(401) Unauthorized".

I've got <identity impersonate="true" /> and I've got <authentication
mode="Windows" />, and I've set up IIS to use Windows Authentication. I
know this works, because I can log into our SQL Server using it.

How do I use the logged in user's credentials to work with WebDav?
The following works fine:
MSXML2.ServerXMLHTTP30 oXmlHttp = new MSXML2.ServerXMLHTTP30();
oXmlHttp.open("PROPFIND", "http://theUrl", false, "Domain\\user",
"password");

This following two produces the error though:
1:
HttpWebRequest Request = WebRequest.Create("http://theUrl") as
HttpWebRequest;
Request.Credentials = CredentialCache.DefaultCredentials;

2:
Principal.WindowsIdentity currWinID =
(Principal.WindowsIdentity)User.Identity;
Principal.WindowsImpersonationContext ic = currWinID.Impersonate();
HttpWebRequest Request = WebRequest.Create("http://theUrl") as
HttpWebRequest;
Request.Credentials = CredentialCache.DefaultCredentials;
Nov 19 '05 #1
4 7942
Pat
John i think you might have to Hardcode it..
I think its not just passing your Atuthentication as you said if you have
imperosnated the user and still doesn't work
What i guess is it can't pass your credentials to the next hop its should be
something with delegation i think it won't do it if you are using
NTLM but with kerberos it should work
Try posting your problem to the security GROUP
Patrick

"John Smith" <m@ty.com> wrote in message
news:Or*************@TK2MSFTNGP15.phx.gbl...
Hey folks,

I'm trying to communicate with our Exchange server using WebDav to get the
User's personal contacts folder. Works fine if I hardcode their username
and password (obviously not an acceptable solution), but when I use
Integrated Authentication I get "(401) Unauthorized".

I've got <identity impersonate="true" /> and I've got <authentication
mode="Windows" />, and I've set up IIS to use Windows Authentication. I
know this works, because I can log into our SQL Server using it.

How do I use the logged in user's credentials to work with WebDav?
The following works fine:
MSXML2.ServerXMLHTTP30 oXmlHttp = new MSXML2.ServerXMLHTTP30();
oXmlHttp.open("PROPFIND", "http://theUrl", false, "Domain\\user",
"password");

This following two produces the error though:
1:
HttpWebRequest Request = WebRequest.Create("http://theUrl") as
HttpWebRequest;
Request.Credentials = CredentialCache.DefaultCredentials;

2:
Principal.WindowsIdentity currWinID =
(Principal.WindowsIdentity)User.Identity;
Principal.WindowsImpersonationContext ic = currWinID.Impersonate();
HttpWebRequest Request = WebRequest.Create("http://theUrl") as
HttpWebRequest;
Request.Credentials = CredentialCache.DefaultCredentials;

Nov 19 '05 #2

John,
I have a similar problem. I am using client on workstation running IE6
that login to ASP.NEt web server using Windows Authentication with
impersonation. The server ASP.NET page uses WebDav to access Exchange
Server 2003. THe WebDav request failes with "The remote server returned
an error: (401) Unauthorized".
If the client is running IE browser on the Web Server , WebDav queries
are succeded.
I've changed Web Server to "trust this computer to delegate", but the
error is the same.

Have you solved your problem?
Regards,
Michael Freidgeim
--
mfreidge
------------------------------------------------------------------------
mfreidge's Profile: http://www.highdots.com/forums/m792
View this thread: http://www.highdots.com/forums/t2923752

Nov 19 '05 #3

I solved my problem. See my post "'To run WebDav queries against
Exchange Folders from ASP.NET -use Kerberos . '
(http://geekswithblogs.net/mnf/archive/2005/09/27/55089.aspx)"
--
mfreidge
------------------------------------------------------------------------
mfreidge's Profile: http://www.highdots.com/forums/m792
View this thread: http://www.highdots.com/forums/t2923752

Nov 19 '05 #4

I solved my problem. See my post "'To run WebDav queries against
Exchange Folders from ASP.NET -use Kerberos . '
(http://geekswithblogs.net/mnf/archive/2005/09/27/55089.aspx)"
--
mfreidge
------------------------------------------------------------------------
mfreidge's Profile: http://www.highdots.com/forums/m792
View this thread: http://www.highdots.com/forums/t2923752

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jody Winston | last post by:
I'd like to present a view of an internal data store, which has Python interface built using SWIG, so that my users can traverse and manipulate the data store using familiar tools. My first...
2
by: rbt | last post by:
Has anyone used pure python to upload files to a webdav server over SSL? I have no control over the server. I can access it with all of the various webdav GUIs such as Konqueror, Cadaver, etc. by...
0
by: Rade Josovic | last post by:
Hi, First implementation of WebDAV protocol is here: WebDAV .NET 1.0 from Independentsoft. Go to http://www.independentsoft.de The WebDAV .NET is WebDAV protocol API for Microsoft .NET...
1
by: sriramva | last post by:
The following code does not work from an ASP.Net application on Windows 2003 IIS 6 (application isolation mode). Basically I am trying to connect to a Sharepoint catalog through the oledb provider...
0
by: Lorenc | last post by:
Microsoft Sharepoint uses webdav to work with documents, so you can open a document right there and upload it by just clicking the save button and it seems that you are working right in the server...
1
by: Infospy | last post by:
Hi! I'm designing a Form Authentication to authenticate users in IIS in order to redirect them, already authenticated, to their webdav folders. This should work like this: IIS AuthApp --->...
0
by: Infospy | last post by:
I have several "http://myserver/myfolder" type of webdav file shares and i'm trying to create a WebApplication to Authenticate users. Problem is i try to use impersonation to validate the user...
0
by: alexander.stuckenholz | last post by:
Hello all, I have a little problem. I use the PEAR component HTTP_WebDAV_Server to provide webdav access to a virtual file system on my server. With NetDrive or WebDrive everything works...
4
by: DudDav | last post by:
Hi All, I have been trying to configured WebDAV on our current IIS server as an alternative to FTP and have had some mixed success but I've hit a brick wall with one problem. The server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.