如何为域里面的ASP.NET站点集成 Windows authentication?

来源:互联网 发布:windows msg 编辑:程序博客网 时间:2024/04/30 12:39

折腾了很多天,最后终于搞定。我在域中integrate Windows authentication的solution基于Windows Server 2003 + IIS6 环境。
 
1. 在IIS中,在该 website 的属性中,
  a. 禁止匿名登录,并选择 integrated Windows authentication;
  b. 注意 virtual directory 的权限,可能需要 script source access 权限;
  c.  App Pool 的 identity 选择 Network Service。
 
2. 在 Web.config 文件中,在 <system.web> 配置节下,
   <!--<identity impersonate="true"/>-->
   <!--<IDENTITY impersonate="true" userName="ww06/xx" password="xx." />-->
  <authentication mode="Windows"/>
   <!--<authorization>
        <deny users="?"/>
   </authorization>-->
 
// 网上关于这里的配置方法乱七八糟。关于这里的原理,我觉得可以参考 http://www.haodi.com.cn/Safety/20051130145740.htm
 
这样,每次用户访问首页的时候,客户端就能自动获取 Windows 当前登录的域账户用做 authentication。
 
Open Issue
 
1. 如果给此 website 设置单独的本地账户 xxuser(记得将该账户添加到IIS_WPG 用户组中),则无法 integrate Windows authentication。无论怎么尝试都是失败的。

原创粉丝点击