Exchange如何集成应用程序直接登录到OWA

 在Exchange中,Exchange本身带了OWA,客户端可以直接通过http://ServerName/Exchange/UserName来访问。以下描述了怎样在页面中集成用户名和密码直接登录到OWA,而不让Windows弹出"Enter network password”对话框。

  在服务器端配置好SSL安全通道,以启用安全通道;关于如何配置SSL安全通道,请参阅 http://support.microsoft.com/default.aspx?scid=kb;EN-US;218445

  将OWA的认证方式设为“Windows集成身份验证”,不要设为“基于表单的身份验证”(使用Exchange系统管理器);

  使用xmlhttp对象发送访问请求,脚本代码如下:

以下是代码片段:
//jeseeqing 2004.10.28
//exchangeURL: for example https://VirtualAD.ExchangeTest.Com/Exchange/jeseeqing
//userName:user name
//password: user password
function RedirectExchangeURL(exchangeURL,userName,password)
{
var xmlRequest= new ActiveXObject("msxml2.xmlhttp");;
xmlRequest.open("get",exchangeURL,false,userName,password);
auth.send();

switch(auth.status)
{
case 200:
window.location.href = exchangeURL;
break;
case 401:
alert("Invalid user or password。");
break;
default:
alert("Sorry, Exchange Server is busy, please try later!");
}
}

  增加一个ASPX页面,在页面的Page_Load事件中注册此脚本,并且传入指定的参数,则会自动跳转到指定的Exchange页面中。

  不过以上代码有点安全问题,如果直接将用户名和密码传入客户端脚本,则用户通过查看网页的源代码可以获取明文的用户名或密码,可以通过在服务器端将用户名和密码加密的方式来保护。

分享到