网站AD验证

https://www.cnblogs.com/HollisYao/archive/2010/04/24/1719539.html

  在ASP.Net程序中实现自动登录,需要以下几个步骤:

第一:

  IIS中取消“启用匿名访问”,启用“集成Windows身份验证”。

第二:

  配置web.config,加入以下标记元素:

  <system.web>

    <authentication mode="Windows" />
    <identity impersonate="true" />

  </system.web>

 <identity impersonate="true" />是用来做身份模拟的,这样在web程序的代码中,可以通过Context.User.Identity.Name获取到已登录的windows身份信息的用户名。

 
https://www.cnblogs.com/chengeng/p/5691249.html

1、获取环境变量

string strAuthUser = request.ServerVariables["AUTH_USER"]

以上这行代码是用来获取当前用户的登录名

 

2、IIS站点设置,除了windows验证启用,其余的全部设置禁用

 

3、对WEB配置

  web.config中加入(针对本站点,建议采用)
  <httpRuntime maxRequestPathLength="360" maxQueryStringLength="1024" /> 

 

  也可以在(针对所有站点)

C:\Windows\System32\inetsrv\config里找到applicationHost.config文件,在,<system.webServer>路径下添加如下配置:添加如下配置:

 

  1. <security>  
  2.       <requestFiltering>  
  3.       <requestLimits maxQueryString="4080" />  
  4.       </requestFiltering>  
  5. </security>  

 

https://jingyan.baidu.com/article/456c463b5b88750a5931445c.html

 

posted @ 2021-07-02 14:34  81  阅读(90)  评论(0编辑  收藏  举报