The remote server returned an error: 401 Unauthorized on WebDAV RRS feed

  • Question

  • I have a application that communicates with exchange 2000 & 2003 using webdav works,  but not in exchange 2007 SP2

    Test Environment and configuration

    • Windows 2003, AD and domain controller, Exchange 2007 SP2
    • With Public Folders
    • OWA can be access through browser
    • can be access through browser
    • The credential use by the application is NetworkCredential
    • Using administrator credentials
    What happens it throws an exception 401 unathorized, I tried using EWS it works. But at this stage, I don't want to convert the code in EWS yet.
    Wednesday, November 10, 2010 7:13 AM

All replies

  • I think it would help if you can find the IIS log entries showing the 401 response.
    Outlook Web Access For PDA , OWA For WAP
    email a@t leederbyshire d.0.t c.0.m
    Wednesday, November 10, 2010 1:40 PM
  • Can you share the code where you set the credentials?  Are you sure you aren't trying to work with the FBA authentication in Exchange 2000/2003?  This wouldn't apply to Exchange 2007 since DAV has it's own virtual directory now.

    Wednesday, November 10, 2010 5:51 PM
  • I'm still a newbie in this stuff so I hope I can give you the information that can help me with my problem.

    @Lee: where can I find the IIS log entries?

    @Matt: Here is the code snippet:

      Public Sub Authenticate1(ByVal UseCredentialCache As Boolean)
        Dim logURI As New Uri(strURI)
        Dim request As HttpWebRequest = System.Net.WebRequest.Create(logURI)
        request.Method = "GET"
        If UseCredentialCache Then
          Dim cc As New CredentialCache()
          cc.Add(logURI, "Negotiate", New NetworkCredential(User, Password, Domain))
          request.Credentials = cc
          request.Credentials = New NetworkCredential(User, Password, Domain)
        End If
        'request.ContentLength = 0
        request.Proxy = Net.WebProxy.GetDefaultProxy()
        Dim response As HttpWebResponse = Nothing
          response = request.GetResponse()
        Catch ex As Exception
        End Try
      End Sub

    The problem was on the line: response = request.GetResponse(), it throws an exception. I'm not sure if this is using FBA or not, this code was from a previous staff that we had that is no longer connected to us. But this works on Exchange 2000/2003.
    Thursday, November 11, 2010 1:12 AM
  • #Software: Microsoft Internet Information Services 6.0
    #Version: 1.0
    #Date: 2010-11-11 04:27:49
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status 
    2010-11-11 04:27:49 GET /public/Contacts - 443 - - 401 2 2148074254
    2010-11-11 04:27:49 GET /public/Contacts - 443 - - 401 1 0
    2010-11-11 04:27:49 GET /public/Contacts - 443 - - 401 1 2148074252
    2010-11-11 04:28:28 GET /public/Contacts - 443 - - 401 2 2148074254
    2010-11-11 04:28:28 GET /public/Contacts - 443 - - 401 1 0
    2010-11-11 04:28:28 GET /public/Contacts - 443 - - 401 1 2148074252
    @Lee: I got the following entries above, it seems a crendentials and server configuration problem. The public virtual directory application pool MSExchangeOWAAppPool is using Local System for the application pool identity. Administrator account was use for the credentials
    Thursday, November 11, 2010 3:42 AM
  • Are you sure that the user name and password you are using as permissions to the public folder?  Can you try a different account and see if that works?
    Thursday, November 11, 2010 12:40 PM
  • No credentials are displayed in the log file, which means that either they weren't really sent along with the GET requests, or they were rejected by the server as an invalid username/password combination.  Have you tried specifying the username in the DOMAIN/USERNAME form, instead of just USERNAME ?

    Outlook Web Access For PDA , OWA For WAP
    email a@t leederbyshire d.0.t c.0.m
    Thursday, November 11, 2010 1:24 PM