min*_*alg 9 windows asp.net security authentication
我正在尝试使用AD /域控制器在客户端网络中部署应用程序.
我的应用程序是一个简单的asp.net c#应用程序,使用Windows身份验证.
我正在使用win2003.
基本上,使用VS2008,创建一个在IIS6.0上托管的新网站.只有2个变化.1.在应用程序的IIS目录安全性上,启用"集成安全性".
注意:匿名也已启用.
生成的骨架代码只有一个更改.将以下内容添加到default.aspx的page_load方法中
using System.Security.Principal;
...
protected void Page_Load(object sender, EventArgs e)
{
WindowsIdentity id = WindowsIdentity.GetCurrent();
Response.Write("<B>Windows Identity Check</B><br>");
Response.Write("Name: " + id.Name + "<br>");
Response.Write("<BR>");
Response.Write("User.Identity: " + User.Identity.Name);
Response.Write("<BR>");
}
Run Code Online (Sandbox Code Playgroud)
浏览到页面的输出: Windows身份检查 - 名称: NT AUTHORITY\NETWORK SERVICE User.Identity:
User.Identity.Name不输出当前用户名.
我补充说:
<authorization>
<deny users="?"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
从我的用户那里,当添加它时,我可以从User.Identity.Name获取当前用户,用户名.
但是,一旦我添加了上述内容,浏览器现在会提示我输入用户名和密码.一旦我输入它,我就可以使用User.Identity.Name来获取用户名.但是我不希望弹出用户名/密码.我希望应用程序根据其网络凭据对用户进行身份验证.
我错过了什么吗?
| 归档时间: |
|
| 查看次数: |
23024 次 |
| 最近记录: |