首次访问分站1时,Request["IASID"]为空,获取站点1信息,并经过一系列加密后,以html方式post到master主站。
<html><head></head><body οnlοad="document.form1.submit()">
<form name="form1" method="post" action="http://localhost:6330/MasterSite/Default.aspx" >
<input name="UserAccount" type="hidden" value="">
<input name="IASID" type="hidden" value="01">
<input name="TimeStamp" type="hidden" value="2011-05-24 15:01">
<input name="AppUrl" type="hidden" value="http://localhost:6331/Site1/Default.aspx">
<input name="Authenticator" type="hidden" value="9sXIXHWGD85bNFAeZJlH6Hk7w+z0hpSQjP9W5jstM6MMOq0D7sLcEXm5fZcOKLgGCdz3mM4QEmuBO7oj9n97LtAtFVLjupvp7HVfsLM6K1umTu3yM6ABMA==">
</form></body></html>
在主站验证HttpContext.Current.Request.Cookies["EACToken"]为空,所以转向到主站的登录页面,
在主站登录页登录后,Session["CurrUserName"] = Login1.UserName;
FormsAuthentication.SetAuthCookie(Login1.UserName, false);
转向主站列表页,列出展示各个分站
点击分站1,搜集分站1信息,经一系列加密后,添加EACToken
HttpContext.Current.Response.Cookies["EACToken"].Value = cookieValue;
HttpContext.Current.Response.Cookies["EACToken"].Expires = DateTime.Now.AddHours(24);
HttpContext.Current.Response.Cookies["EACToken"].Path = "/";
接着主站post发送到分站1
<html><head></head><body οnlοad="document.form1.submit()">
<form name="form1" method="post" action="http://localhost:6331/Site1/Default.aspx" >
<input name="UserAccount" type="hidden" value="admin">
<input name="IASID" type="hidden" value="01">
<input name="TimeStamp" type="hidden" value="2011-05-24 15:43">
<input name="AppUrl" type="hidden" value="http://localhost:6331/Site1/Default.aspx">
<input name="Authenticator" type="hidden" value="5psvdFECOjIBkB3oeysvaJbuA0OJsMMDkurlMRrBXWMWG/7SW/u0OybfE0o5btDrMNCfLBLR6vXOfeApUcS9Qop/4fxfiSfPTetPVtRruIt9hDw8Hv3CnoynO8IOgPFL">
</form></body></html>
分站1 验证主站post来的token,若正确,则取出用户名Request["UserAccount"]
分站2 首次加载时,Request["IASID"]为空,搜集站点2信息,一系列加密后post到主站master
<html><head></head><body οnlοad="document.form1.submit()">
<form name="form1" method="post" action="http://localhost:6330/MasterSite/Default.aspx" >
<input name="UserAccount" type="hidden" value="">
<input name="IASID" type="hidden" value="02">
<input name="TimeStamp" type="hidden" value="2011-05-24 16:09">
<input name="AppUrl" type="hidden" value="http://localhost:6332/Site2/Default.aspx?ReturnUrl=/Site2/Default2.aspx">
<input name="Authenticator" type="hidden" value="6h1rbGuS4AVvfAVxC7NxP6m65clrKs9CLuqp7FmamkbJ7SMGDk7wgcmBPtE3L1OKviEf/2ms8FlcvB5DggZ/lnMKIOiPG5PKthC2GBrO2SL9KkYNuYX2DaIxN8Utd1NS5n6uKlMlO7YUXzu5YI4ipw5SgG1I02R4">
</form></body></html>
主站验证VACCookie 已经存在 解密出 用户名
主站验证通过 将用户信息和分站2信息 加密后 post回分站2