WebDAV and Authenticating User against Exchange

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: OWA Authentication ? Domain/Name
    ... sub-directories (under Authentication -> Access Control) will be set as ... We can add the domain name in the Exchange virtual directory, ... If the domain name specified for ExchWeb/Bin is not configured and it is ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: OWA Authentication ? Domain/Name
    ... we need not tick the option "Basic Authentication (password is sent in ... Exchange 2003 SP1 replaces the OWA logon screen (Program ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: SBS 2003 PDA Sync Problem - Error 0x85010014
    ... that could not get his PDA to sync and was getting the same error. ... Export all mails in Mailbox as .PST file. ... Remove the Exchange Attribute for problematic user with corrupt ... Please verify Authentication settings by the following steps. ...
    (microsoft.public.backoffice.smallbiz)
  • RE: Can no longer access ActiveSync
    ... OMA and Exchange/Exchange-OMA virtual directory. ... Please verify Authentication settings by the following steps. ... Open IIS Manager ... issue may be caused by the Exchange attribute of original user account. ...
    (microsoft.public.exchange.admin)
  • Re: SBS 2003 PDA Sync Problem - Error 0x85010014
    ... Export all mails in Mailbox as .PST file. ... Remove the Exchange Attribute for problematic user with corrupt Exchange ... Please verify Authentication settings by the following steps. ... Open IIS Manager ...
    (microsoft.public.backoffice.smallbiz)