This documentation is archived and is not being maintained.

Integrated Windows Authentication

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Sign-in with integrated Microsoft Windows authentication is very similar to sign-in using the forms. The only difference is that no user credentials are specified in the logon request.

The following C# snippet provides such an example for signing in using integrated Windows authentication:

public bool Logon( string uri)
{
   string strRequest =
                "<cwaRequests>" +
                "   <logon>" +
                "   </logon>" +
                "</cwaRequests>";
   XmlDocument xmlRequest = new XmlDocument();
   xmlRequest.LoadXml(strRequest);
   SendRequest("http://www.contoso.com/iwa/logon.html;",
                   xmlRequest);

   return this.authTicket != null;
}

An implementation of the SendRequest is shown in Setting Up Sign-in and Command Channels.

JavaScript Code Snippet for Signing in

function DoLoginIWA(user, domain, passWord, sipUri)
{
    var requestBody = "<cwaRequests><logon>"
                   += "</logon></cwaRequests>";

    var url = "http://cwa.contoso.com/iwa/logon.html";
    req.open("POST", url, false);
    req.send(requestBody);

    authTicket = req.getResponseHeader("CWA-Ticket");
    if(req.readyState == 4 && req.status == 200 && authTicket != "")
    {
        isAuthenticated = true;
    }

}
Show: