Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Development / July 2008

Tip: Looking for answers? Try searching our database.

WebDAV and Authenticating User against Exchange

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenbo - 08 Jul 2008 17:29 GMT
Hi, I have the following setup.
Exchange Server with Forms based authentication.
Customised owalogon.asp redirects to custom asp.net page to display
informationals to users

I am using WebDAV and .NET to authenticate the user in the asp.net.
The following are the links for exchange.

https://prepro01/exchange, which redirects when hit to this url ->
https://prepro01/exchweb/bin/auth/owalogon.asp?url=https://prepro01/exchange&reason=0.

In the custom asp.net page we do the following code:

string authURI = "https://prepro01" + "/exchweb/bin/auth/owaauth.dll";

           string destination = "https://prepro01" + "/exchange/";

           // Create the web request body:
           // UserFullname is DOMAIN\\username
           string body =
string.Format("destination={0}&username={1}&password={2}",
destination, userFullName, password);
           byte[] bytes = Encoding.UTF8.GetBytes(body);

           // Create the web request:
           HttpWebRequest request =
(HttpWebRequest)System.Net.WebRequest.Create(authURI);

           request.Method = "POST";
           request.ContentType = "application/x-www-form-urlencoded";
           request.CookieContainer = new CookieContainer();
           request.ContentLength = bytes.Length;

           // Create the web request content stream:
           using (Stream stream = request.GetRequestStream())
           {
               stream.Write(bytes, 0, bytes.Length);
               stream.Close();
           }

           try
           {

               // Get the response & store the authentication
cookies:
               HttpWebResponse response =
(HttpWebResponse)request.GetResponse();

               if (response.Cookies.Count < 2)
               {
                   //throw new AuthenticationException("Login failed.
Is the login / password correct?");
               }

               //cookies = new CookieContainer();
               foreach (Cookie myCookie in response.Cookies)
               {
                   request.CookieContainer.Add(myCookie);
               }

               response.Close();

               return true;
           }

When this is run I get no cookies returned. So obviously the login is
failing. But why, I am sending to the wrong links? I have pretty much
used code from Henning Krause, but no luck. WebDAV is on in the server
with Exchange now.

Any ideas?
Thanks
Eamonn
Jenbo - 14 Jul 2008 10:26 GMT
Check out

http://www.infini-tec.de/post/2004/12/Get-the-WebDAV-url-for-an-Exchange-2000200
3-mailbox.aspx


For building the correct WebDav URL for exchange.

E
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.