Welcome to MSDN Blogs Sign in | Join | Help

Le Café Central de DeVa

DeVa's Developer Messaging blog!!

News

  • <font color="WHITE">Le Café Central de DeVa</font> DeVa rocks!!

    My XBOX Live

    XBox Live

    Disclaimer:
    This weblog/blog is solely my opinion.The information in this weblog/blog is provided "AS IS" with no warranties, and confers no rights. This weblog/blog does not represent the thoughts, intentions, plans or strategies of my employer. Inappropriate comments will be deleted at the authors discretion.

    Use of included script samples are subject to the terms specified in the Terms of Use
    .

    Privacy Statement:
    I do not collect personal data associated with comments posted to this site.


    Translate into your language

    Site Statistics
    Locations of visitors to this page






    Make a difference


    Subscription offer


    Developer resources



    Students free software

    Try & Test Drive Online

    More about Windows 7
    Download
    Virtual Roundtable with Mark Add to Calendar

    Experiences

    Go Green!!



How to authenticate the Inbox in Microsoft Exchange Server 2003 with forms-based authentication enabled?

Please find the Code Snippet Access Exchange Server 2003 using WebDAV in your Web application per KB:

   1:  'Declaration Section
   2:  Dim strServerName as String = "Server Name"     'TODO: Change to your environment
   3:  Dim strDomain as String = "Domain Name"       'TODO: Change to your environment
   4:  Dim strUserID as String = "Username"            'TODO: Change to your environment
   5:  Dim strPassword as String = "Password"        'TODO: Change to your environment
   6:   
   7:  ' Create our destination URL.
   8:  Dim strURL As String = "https:/" & strServerName & "/exchange" & strUserName & "/inbox/test.eml"
   9:  Dim strReusableCookies As String
  10:   
  11:  ' Create our Web request object.
  12:  GETRequest = CType(WebRequest.Create(New System.Uri(strURL & strApptItem)), HttpWebRequest)
  13:  strReusableCookies = AuthenticateSecureOWA(strServerName, strDomain, strUserID, strPassword)
  14:   
  15:  ' Add the cookie set that is obtained after OWA authentication to our request header.
  16:  PROPPATCHRequest.Headers.Add("Cookie", strReusableCookies)
  17:  PROPPATCHRequest.ContentType = "text/xml"
  18:  PROPPATCHRequest.KeepAlive = True
  19:  PROPPATCHRequest.AllowAutoRedirect = False
  20:   
  21:  ' Specify the PROPPATCH method.
  22:  PROPPATCHRequest.Method = "GET"
  23:   
  24:  ' Enter your WebDAV-related code here.
  25:  ...

There are two ways of implementing this.

Method # 1: In the Visual Basic .NET code sample that was just mentioned, the strReusableCookies string variable is the authentication cookie that is returned from the AuthenticateSecureOWA function call. If the authentication cookie times out, call the AuthenticateSecureOWA function again to receive a new authentication cookie.

Method # 2: Put the WebDAV request in a try/catch block. The try/catch block will catch the authentication cookie time-out error. When the authentication cookie time-out error occurs, you can re-authenticate the Inbox in Exchange Server 2003 to the Exchange Server 2003 server that is enabled with forms-based authentication.

Comments

No Comments

New Comments to this post are disabled
Page view tracker